Repository navigation
Conversation
jsonnet_string_parse_unicode cast each char32_t of the escape to unsigned char before the hex digit check, so any code point whose low byte is a hex digit was accepted as that digit. For example "\u00ŁŁ" (U+0141) decoded to U+00AA instead of failing. Compare the full code point and print the offending character as UTF-8 in the error.
This branch has not been deployed
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.
jsonnet_string_parse_unicode cast each char32_t of a \uXXXX escape to unsigned char before the hex digit check, so any code point whose low byte is 0-9, A-F or a-f was taken as that digit. "\u00ŁŁ" (U+0141 truncates to 'A') unescaped to U+00AA, and Arabic-Indic or Devanagari digits behave the same way, so the source no longer shows which character the escape produces. go-jsonnet rejects these. the check now compares the full code point, and the error prints the offending character as utf-8. valid escapes are unchanged. added a test_suite golden case, which evaluated to "ª" before the fix. test_suite and ctest pass. i couldn't run test_cmd here because it needs gnu sed.