From c026e44bb557dc42516785beba00452fa462738e Mon Sep 17 00:00:00 2001 From: tompng Date: Mon, 20 Jan 2025 20:42:20 +0900 Subject: [ruby/json] Fix parsing incomplete unicode escape "\uaaa" https://github.com/ruby/json/commit/86c0d4eb7e --- ext/json/parser/parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/json/parser/parser.c') diff --git a/ext/json/parser/parser.c b/ext/json/parser/parser.c index 907bd0477b..de72edf4e7 100644 --- a/ext/json/parser/parser.c +++ b/ext/json/parser/parser.c @@ -630,7 +630,7 @@ static VALUE json_string_unescape(JSON_ParserState *state, const char *string, c unescape = (char *) "\f"; break; case 'u': - if (pe > stringEnd - 4) { + if (pe > stringEnd - 5) { raise_parse_error("incomplete unicode character escape sequence at '%s'", p); } else { uint32_t ch = unescape_unicode((unsigned char *) ++pe); -- cgit v1.2.3