Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix segmentation fault in menoh_impl::extract_needed_node_list #23

Merged
merged 3 commits into from
Jun 25, 2018

Conversation

msakai
Copy link
Member

@msakai msakai commented Jun 25, 2018

This fixes segmentation fault in menoh_impl::extract_needed_node_list reported in #9.

std::find_if(node_list.begin(), node_list.end(), pred) returns node_list.end() when no elements node_list satisfy the pred, therefore returned iterator must not be dereferenced without proper check.

msakai added 2 commits June 25, 2018 14:08
…-research#9)

std::find_if(node_list.begin(), node_list.end(), pred) returns
node_list.end() when no elements node_list satisfy the pred, therefore
returned iterator must not be dereferenced without proper check.
@msakai msakai requested a review from okdshin June 25, 2018 05:31
modify style
@okdshin okdshin merged commit 9d3d122 into pfnet-research:master Jun 25, 2018
@okdshin
Copy link
Contributor

okdshin commented Jun 25, 2018

Thank you! I could not find it.

@msakai
Copy link
Member Author

msakai commented Jun 26, 2018

C++ is really difficult to use correctly.
I'm a bit relieved that it also applies to C++ expert like you ;-)

@msakai msakai deleted the fix-issue9 branch July 3, 2018 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants