Reject U+001F in string literals (fix #2909)#2911
Merged
nicowilliams merged 1 commit intojqlang:masterfrom Sep 26, 2023
Merged
Conversation
wader
approved these changes
Sep 26, 2023
Member
wader
left a comment
There was a problem hiding this comment.
Worth to have some regression test for this? spent some time trying to one but didn't come up with any neat way. I guess not possible as a jq query (implode will escape)? so maybe something in shtest?
S=""; for i in $(seq 0 1 255) ; do printf "\"\\$(printf %03o $i)\"" | jq >/dev/null 2>&1 ; if [ $? != 0 ]; then S="$S $i"; fi ; done ; echo $S
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 34 92
Contributor
|
Thanks! |
itchyny
added a commit
to itchyny/jq
that referenced
this pull request
Feb 17, 2025
Whether `char` has a sign is implementation dependent, and `c >= 0` may result in a compiler warning. We can use bitwise operator to check whether the character is a control character, regardless of the sign.
itchyny
added a commit
to itchyny/jq
that referenced
this pull request
Feb 17, 2025
Whether `char` has a sign is implementation dependent, and `c >= 0` may result in a compiler warning. We can use bitwise operator to check whether the character is a control character, regardless of the sign.
itchyny
added a commit
that referenced
this pull request
Feb 17, 2025
Whether `char` has a sign is implementation dependent, and `c >= 0` may result in a compiler warning. We can use bitwise operator to check whether the character is a control character, regardless of the sign.
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.
This fixes the bounding check errors as reported by #2909.