Validate number length when coercing String to double - #6179
Merged
Conversation
pjfanning
reviewed
Aug 30, 2026
JooHyukKim
reviewed
Aug 31, 2026
JooHyukKim
reviewed
Aug 31, 2026
Code Review ✅ ApprovedAdds validation of number length when coercing String to OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
cowtowncoder
approved these changes
Sep 1, 2026
cowtowncoder
added a commit
that referenced
this pull request
Sep 1, 2026
Adds #6179 release note under the 3.2.3 section. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9szXocjFE7evZHNj9GWdj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a JSON string is coerced to a
double, the value goes throughStdDeserializer._parseDoublePrimitive, which hands the text straight to the double parser. Its sibling_parseFloatPrimitive, right above it, first checksNumberInput.looksLikeValidNumberand then callsstreamReadConstraints().validateFPLength()so the configuredmaxNumberLengthlimit applies before parsing, but the double variant skips both. The effect is thatfloat[]rejects an over-length numeric string whiledouble[],OptionalDouble, and the general String-to-double coercion accept it, so a length limit the user configures is not honored on those paths. I noticed it while comparing the two primitive helpers, since every integer-family helper in the same class already validates length the same way. The fix applies the same pre-validation to the double path so both behave alike. Added a test in thedeser/dospackage coveringdouble[], alongsidefloat[]which already enforces the limit.