zserge / jsmn

Jsmn is a world fastest JSON parser/tokenizer. This is the official repo replacing the old one at Bitbucket
MIT License
3.65k stars 778 forks source link

Invalid JSON parsed as valid #158

Open Karhenpl opened 5 years ago

Karhenpl commented 5 years ago

in JSMN_STRICT mode, jsmn_parse function returns > 0 value but following strings should be invalid: { "a": } --> 2 { "a"} --> 2 {"a" "b"} --> 3 {"a" :::::: "b"} --> 3 {"a" : [1 "b"]} --> 5 {"a"""} --> 3 {"a":1""} --> 3 {"a":1"b":1} --> 3

pt300 commented 5 years ago

Will fix as this library gets a bit of rework. Right now I'm busy with life matter. Sorry

z1617 commented 4 years ago

{}{} is also valid --> pos=4 toknext=2 toksuper=-1 r=2