json: reject overflowing quoted float values - #403
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
sylvesterkaczmarek
left a comment
There was a problem hiding this comment.
A larger quoted finite value still slips through: "1e400" parses to f64::INFINITY, so value.is_finite() is false and the new overflow guard accepts it as f32::INFINITY. Since the only valid non-finite strings are handled by the explicit "Infinity" / "-Infinity" branches above, should any non-finite result from the numeric parse path be rejected?
|
[claude code] The shape is right — same expectation string as
Smaller: the fragment bolds the whole sentence and lacks Pre-existing and separate: reflect's |
What changed
"3.5e38"being silently decoded as positive infinity.f64parse before converting tof32, matching the existing unquoted-number behavior."NaN","Infinity", and"-Infinity"working.Tests
task lintcargo test --workspace