lwjson icon indicating copy to clipboard operation
lwjson copied to clipboard

Incorrectly accepts form-feed

Open d0sboots opened this issue 2 years ago • 2 comments

prv_skip_blank has the following comment:

Skip all characters that are considered *blank* as per RFC4627

However, \f has never been considered a whitespace character in RFC4627.

Also applies to streaming mode.

d0sboots avatar Sep 14 '22 18:09 d0sboots

skip blank character only applies when outside string parsing. Should we treat \f with special attention?

I am not sure I understand where the problem is - you have test JSON that fails?

MaJerle avatar Sep 14 '22 18:09 MaJerle

I am not sure I understand where the problem is - you have test JSON that fails?

Sure. Your library will parse "{\f}" as an empty object, but it's not valid JSON. (Here the \f denotes the form-feed character, i.e. if you used that string literal in C or JS to make the test case, it should fail.)

d0sboots avatar Sep 14 '22 19:09 d0sboots