From: Igor Sysoev Date: Tue, 18 Oct 2016 12:48:22 +0000 (+0300) Subject: Invalid Unicode code point processing has been fixed. X-Git-Tag: 0.1.4~7 X-Git-Url: http://git.kaiwu.me/postgresql/log/contrib/postgres_fdw/static/gitweb.js?a=commitdiff_plain;h=ef36a64275684c353f2b93bac4526c311f855aa7;p=njs.git Invalid Unicode code point processing has been fixed. --- diff --git a/njs/njs_parser.c b/njs/njs_parser.c index 9dda40c6..bb42bd55 100644 --- a/njs/njs_parser.c +++ b/njs/njs_parser.c @@ -2135,6 +2135,9 @@ njs_parser_escape_string_create(njs_vm_t *vm, njs_parser_t *parser, if (dst != NULL) { dst = nxt_utf8_encode(dst, (uint32_t) u); + if (dst == NULL) { + goto invalid; + } } } diff --git a/njs/test/njs_unit_test.c b/njs/test/njs_unit_test.c index 7cee5636..5ffee20f 100644 --- a/njs/test/njs_unit_test.c +++ b/njs/test/njs_unit_test.c @@ -2660,6 +2660,9 @@ static njs_unit_test_t njs_test[] = { nxt_string("'\\u{1234567}'"), nxt_string("SyntaxError: Invalid Unicode code point \"\\u{1234567}\" in 1") }, + { nxt_string("'\\u{a00000}'"), + nxt_string("SyntaxError: Invalid Unicode code point \"\\u{a00000}\" in 1") }, + { nxt_string("'\\x61'"), nxt_string("a") },