Fix use of uninitialized value in check_literal (fix #3316) (#3324)

This commit is contained in:
itchyny authored and GitHub committed 2025-05-18 08:06:54 +09:00
1 parent ecea2d29bd
commit 96d19ca2ee
1 file changed
+1 -1
+1 -1
View File
@@ -516,7 +516,7 @@ static pfunc check_literal(struct jv_parser* p) {
return "Invalid string literal; expected \", but got '";
case 'n':
// if it starts with 'n', it could be a literal "nan"
if (p->tokenbuf[1] == 'u') {
if (p->tokenpos > 1 && p->tokenbuf[1] == 'u') {
pattern = "null"; plen = 4; v = jv_null();
}
}