Fixed a wrong condition in scan_hex; fix #3774

This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-08-11 14:14:30 +09:00
parent 96d4c2d385
commit 56d4e41d76
+1 -1
View File
@@ -3783,7 +3783,7 @@ scan_hex(parser_state *p, const int *start, int len, int *retlen)
}
*retlen = s - start;
if (retval > 0x10FFFF || (retval & 0xFFFFF800) == 0xD800) {
if (*retlen == 0 || retval > 0x10FFFF || (retval & 0xFFFFF800) == 0xD800) {
yyerror(p, "Invalid Unicode code point");
return -1;
}