json-rust icon indicating copy to clipboard operation
json-rust copied to clipboard

Incorrectly accepting input with form feeds?

Open erickt opened this issue 6 years ago • 0 comments

I just ran https://github.com/nst/JSONTestSuite to see how we're doing, and I saw that json-rust is accepting this sample that's supposed to fail parsing. According to the grammar, the allowed whitespace characters are:

      ws = *(
              %x20 /              ; Space
              %x09 /              ; Horizontal tab
              %x0A /              ; Line feed or New line
              %x0D )              ; Carriage return

Form feed is %x0C. I think if you replaced this code with b' ' | b'\n' | b'\t' | b'\r' => ... you should be safe.

erickt avatar Sep 02 '17 20:09 erickt