Fix parsing of "-Infinity" when the "-" and "Infinity" are split across multiple calls.
Add several additional test cases for partial parsing of infinity values.
This commit is contained in:
1 parent
4d1e0b4409
commit
48f7e389fb
2 files changed
+35
-1
No files matched your search
+1
-1
@@ -763,7 +763,7 @@ struct json_object* json_tokener_parse_ex(struct json_tokener *tok,
|
||||
printbuf_memappend_fast(tok->pb, case_start, case_len);
|
||||
|
||||
// Check for -Infinity
|
||||
if (tok->pb->buf[0] == '-' && case_len == 1 &&
|
||||
if (tok->pb->buf[0] == '-' && case_len <= 1 &&
|
||||
(c == 'i' || c == 'I'))
|
||||
{
|
||||
state = json_tokener_state_inf;
|
||||
|
||||
Reference in new issue
Block a user