pquerna / ffjson

faster JSON serialization for Go
Apache License 2.0
2.97k stars 234 forks source link

Nan is accepted as valid JSON #241

Closed djmitche closed 6 years ago

djmitche commented 6 years ago

The string NaN is not valid JSON. Yet Unmarshaling it does not fail on this input. In particular, [1, NaN, 2] in my experimentation unmarshals to []float64{1, 2}, meaning not only is invalid JSON accepted, but the resulting value doesn't even match what you might expect!