Repository navigation
Conversation
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.
checkJSONFloat64Range only validates the numeric range of an RFC7951 JSON number bound for an int8/16/32 or uint8/16/32 leaf and never checks that it is a whole number, so yangFloatIntToGoType then narrows it with int8(v)/uint8(v) and Unmarshal silently accepts 3.9 for a uint8 leaf and stores 3. The same conversion is reached for leaves, leaf-lists, and integer union members, so a fractional value is quietly truncated in each. Reject a float64 that carries a fractional part before the range check so these inputs error out instead of being silently rounded.