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:
Eric Haszlakiewicz committed 2017-11-27 00:04:33 -05:00
1 parent 4d1e0b4409
commit 48f7e389fb
2 files changed
+35 -1

No files matched your search

+1 -1
View File
@@ -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;