4 ms·
Maybe I'm dense, but why does this affect apps that use JSON?
by djacobs 16y ago
Maybe I'm dense, but why does this affect apps that use JSON?
- snewman 16y agoBecause JSON can include floating-point numbers. If you pass { foo: 2.2250738585072012e-308 } to any JSON service, I'd expect it to invoke Double.parseDouble(...) as part of its input processing, and trip over the bug. This would probably occur before any type checking of the input, and thus would probably work even for a service which does not expect floating-point inputs.
- djacobs 16y agoSo the exact same bug affects Javascript?
- eru 16y agoJSON just makes it quite easy to parse in a floating point number. But that doesn't have anything to do with Javascript per-se.
- woogley 16y agoThis is not correct. Think about a service which used PHP's json_decode function. PHP has fixed this bug, so there would be no issue. The problem has nothing to do with JSON. It only affects JSON parsers that run on a JVM.
- snewman 16y agoRight -- when I said "any service that accepts JSON input", I meant "any JVM-based service that accepts JSON input". I thought the JVM qualification would be clear from the context of this thread, apologies if it wasn't.