Repository navigation
Reject out-of-range JSON integer values - #746
Merged
liuzicheng1987 merged 1 commit intoOct 18, 2026
Merged
liuzicheng1987 merged 1 commit into
liuzicheng1987 merged 1 commit into
Conversation
Collaborator
|
@sean0407 thanks for the contribution. I am merging. |
liuzicheng1987
merged commit Oct 18, 2026
bb195e2
into
munich-data-engineering:main
176 checks passed
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.
Summary
Reader::to_basic_typenow checks JSON integer values against the target type's bounds before casting. The focused regression covers the reporteduint16_toverflow, signed upper/lower overflow, and valid narrow integer boundaries.Fixes #682.
Evidence
uint16_t portparsed from{"port":100200}was accepted as34664.int16_tvalues outside both bounds are rejected;INT16_MINandUINT16_MAXstill round-trip.tests/json/test_integers.cppcompiled with C++20 and-Wall -Werrorand ran in an isolated network-disabled container (2 tests passed);git diff --check; patch policy accepted 2 text files with no binary changes.Merge Danger
Door: Two-way
Blast Radius: Parsing
Only JSON integer conversion to narrower integral types changes; values outside the destination type's representable range now return an error.