Skip to content

Fix iterator-invalidation bug in ansi-c/padding.cpp #836

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

Merged
merged 1 commit into from
Apr 17, 2017

Conversation

reuk
Copy link
Contributor

@reuk reuk commented Apr 16, 2017

The insert on line 262 invalidates the iterators of the vector which is
being iterated, which may cause the reference on line 206 to dangle.
This in turn leads to undefined behaviour on line 269 when the reference
is passed to a function.

The fix is to take a copy instead of a reference on line 206.

The insert on line 262 invalidates the iterators of the vector which is
being iterated, which may cause the reference on line 206 to dangle.
This in turn leads to undefined behaviour on line 269 when the reference
is passed to a function.

The fix is to take a copy instead of a reference on line 206.
@reuk reuk changed the title Fix pointer-invalidation bug in ansi-c/padding.cpp Fix iterator-invalidation bug in ansi-c/padding.cpp Apr 17, 2017
@kroening kroening merged commit f79100f into diffblue:master Apr 17, 2017
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.

3 participants