-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Null bytes in files are treated like EOF #1095
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I have a working fix for this, however, it causes a knock-on that I believe is desirable. The following test(and a few other almost identical ones) now fail:
This makes sense as the explicit I would just change the test to be a Is that fine? Edit: I've attached my work-in-progress as a PR for reference. |
Thanks for the PR! I added some comments, and I need to think whether there is another use case that needs to be tested. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@FrancoisChabot It would be great if you could have another look at #1452. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
When reading parsing JSON from a file, null bytes are treated as EOF. The reason for this is explicit code in the JSON lexer to treat
\0
as EOF to properly parse string literals.Parse file https://github.com/nst/JSONTestSuite/blob/master/test_parsing/n_multidigit_number_then_00.json, e.g. by
Parse error: unexpected null byte after reading
123
.The file is successfully parsed as number
123
.Apple LLVM version 9.1.0.
develop
branch?develop
.N/A
The text was updated successfully, but these errors were encountered: