mjson
mjson copied to clipboard
[bug]accept invalid numbers
The parser accepts invalid numbers (i.e., leading zeros). This is not allowed according to the specification in section 2.4.
It can be reproduced with the input: {"a":00000000}
also accept invalid strings (i.e., containing unescaped control characters), which is not allowed according to the section 7 of specification.
It can be reproduced with the following buf:
char buf[4];
buf[0] = '\"';
buf[1] = 1; // this is unescaped control characters
buf[2] = '\"';
buf[3] = 0;