-
-
Notifications
You must be signed in to change notification settings - Fork 796
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
_inputPtr off-by-one in UTF8StreamJsonParser._parseNumber2() #516
Comments
Thank you for reporting this. I hope to verify this as soon as possible, added it to work-in-progress page. |
I think the fix is simply to remove the post-increment of
but there's a lot of index juggling going on, so I'm leaving that entirely up to you :) |
(Note that this issue doesn't affect me in any way, just stumbled upon it while reading the code looking for something else) |
Thank you for reporting it. Rarely encountered edge cases are pretty nasty exactly as they do not get reported as quickly as common ones. I am bit surprised I didn't notice this when I went over with last pass but better late than never. Regression test is essential here. |
@gsson I think you are absolutely right wrt removing it. Code is bit awkward there (in other loops there's no need to try to re-access it), but it's not the common case. Reader-based parser actually does not trip in this case, as code is structured bit differently. |
When an input contains space separated root level values, and the input is split such that
_parseNumber2()
is invoked,_inputPtr
will become incremented once in the methodand once in
_verifyRootSpace()
:causing the next token to lose its first character.
Related to #105.
Failing test case:
The text was updated successfully, but these errors were encountered: