Skip to content

Commit

Permalink
Reject U+001F in string literals (fix #2909)
Browse files Browse the repository at this point in the history
  • Loading branch information
itchyny authored and nicowilliams committed Sep 26, 2023
1 parent e526df1 commit 0714939
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/jv_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ static pfunc found_string(struct jv_parser* p) {
return "Invalid escape";
}
} else {
if (c > 0 && c < 0x001f)
if (c >= 0 && c <= 0x001f)
return "Invalid string: control characters from U+0000 through U+001F must be escaped";
*out++ = c;
}
Expand Down

0 comments on commit 0714939

Please sign in to comment.