Fixed a wrong condition in `scan_hex`; fix #3774

parent 96d4c2d3
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment