lwjson
lwjson copied to clipboard
Incorrectly accepts form-feed
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.
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?
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.)