-
-
Notifications
You must be signed in to change notification settings - Fork 399
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 out-of-bounds read in statement tail parser #996
Fix out-of-bounds read in statement tail parser #996
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. This codebase doesn't have this tradition, but I've found it super handy to add a link to the issue (say, right before line 862) explaining the exotic/missing-incr for loop.
@Prinzhorn does this PR make your random-failure test harness pass?
@kkrypt0nn can you verify this locally? Does it fix the randomness for you? I can't look into this rn. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to help! 😄 Hope we can get this merged and released soon – just need code owner review too 👀 |
@JoshuaWise can you take a look please? |
Thanks for finding the source of this bug. The only problem I see is that your solution breaks when there's a newline after Also, we should add tests for all of these cases 😅 |
Ahhhh, you're quite right, @JoshuaWise. These dang nested loops! We should be able to solve that by doing |
800e16a
to
5ba7d7c
Compare
5ba7d7c
to
36cc72a
Compare
O-kay, I think that does it now. The tail parser should (touch wood) skip the right number of characters in the right places now, and I've added a variety of little test cases to that effect. Everything passes locally, let's hope the pipeline here concurs. @mceachen @JoshuaWise Please have a look and maybe we can get this little bug fixed 🙏 |
LGTM, thanks! |
Fixes #975
I would love to include a regression test with this PR, but as the problem only occurs when reading random noise past the end of a string, I have no idea how to accomplish such a feat.