vivkin / gason

Lightweight and fast JSON parser for C++
MIT License
338 stars 51 forks source link

do not fail on all-whitespace #14

Closed cdunn2001 closed 9 years ago

cdunn2001 commented 9 years ago

Currently, this reads past the buffer if the input is all whitespace. If it's null-terminated, isspace() will return false, but *s then violates the loop-invariant (!=0). Failing on bad input is fine, but crashing is a security hole, yes?

I don't want to add the extra test. The code is so efficient. Maybe there is a better way to handle this?