- What is the issue you have?
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.
- Please describe the steps to reproduce the issue. Can you provide a small but working code example?
Parse file https://github.com/nst/JSONTestSuite/blob/master/test_parsing/n_multidigit_number_then_00.json, e.g. by
std::ifstream f("n_multidigit_number_then_00.json");
json::parse(f);
- What is the expected behavior?
Parse error: unexpected null byte after reading 123.
- And what is the actual behavior instead?
The file is successfully parsed as number 123.
Apple LLVM version 9.1.0.
- Did you use a released version of the library or the version from the
develop branch?
develop.
N/A
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
\0as 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.
developbranch?develop.N/A