mirror of
https://github.com/json-c/json-c.git
synced 2026-04-11 00:09:06 +08:00
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:
@@ -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