Skip to content

Commit 587a651

Browse files
committed
Fix fuzz issue related to json_parser changes
1 parent 13f8cb3 commit 587a651

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

include/jsoncons/json_parser.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,6 +1715,13 @@ class basic_json_parser : public ser_context
17151715
JSONCONS_UNREACHABLE();
17161716
}
17171717
minus_sign:
1718+
if (JSONCONS_UNLIKELY(cur >= local_input_end)) // Buffer exhausted
1719+
{
1720+
number_state_ = parse_number_state::minus;
1721+
buffer_.append(hdr, cur);
1722+
position_ += (cur - hdr);
1723+
return cur;
1724+
}
17181725
if (jsoncons::utility::is_nonzero_digit(*cur))
17191726
{
17201727
++cur;

0 commit comments

Comments
 (0)