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

fixed stack-use-after-scope when assigning message_reader #32

Merged
merged 1 commit into from
Oct 11, 2020

Conversation

mvanslobbe
Copy link

Thank you for the great work on this library! Getting started with it has been effortless!

I've hit the same bug as encountered in #27 and solved it in the easiest way possible - by making the copy constructor and assignment operator 're-init' and thus use the const_iterator correctly. In doing so I realize that this is of course less efficient ( init() does do work ) but this fix has the benefit of being correct. Also it doesn't change the behaviour.

There's a unit test in here, which replicates the problem if you run under asan, and shows that the problem is now resolved.

Please let me know what you think.

@jamesdbrock
Copy link
Owner

Thank you very much for the PR @mvanslobbe , I will check it out.

@jamesdbrock jamesdbrock merged commit db09519 into jamesdbrock:master Oct 11, 2020
@jamesdbrock
Copy link
Owner

Brilliant, thank you @mvanslobbe

jamesdbrock added a commit that referenced this pull request Oct 11, 2020
fixed stack-use-after-scope when assigning message_reader
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