Reject U+001F in string literals (fix #2909)

This commit is contained in:
itchyny authored and Nico Williams committed 2023-09-26 12:53:44 -05:00
1 parent e526df15fe
commit 07149397d1
1 file changed
+1 -1
+1 -1
View File
@@ -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;
}