From 8095f7e166c71ce7a8c594e6959f6c7520348f08 Mon Sep 17 00:00:00 2001 From: itchyny Date: Tue, 26 Sep 2023 22:03:39 +0900 Subject: [PATCH] Reject U+001F in string literals (fix #2909) --- src/jv_parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jv_parse.c b/src/jv_parse.c index 62f0e1d872..3be9360833 100644 --- a/src/jv_parse.c +++ b/src/jv_parse.c @@ -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; }