mjson icon indicating copy to clipboard operation
mjson copied to clipboard

[bug]accept invalid numbers

Open Dongmuliang opened this issue 3 years ago • 1 comments

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}

Dongmuliang avatar Dec 27 '22 22:12 Dongmuliang

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;

boofish avatar Jul 06 '23 14:07 boofish