mirror of
https://github.com/DaveGamble/cJSON
synced 2025-04-28 14:17:56 +00:00
fix fail to catch last backslash # 780
This commit is contained in:
parent
cb8693b058
commit
12c05dafac
2
cJSON.c
2
cJSON.c
@ -792,7 +792,7 @@ static cJSON_bool parse_string(cJSON * const item, parse_buffer * const input_bu
|
||||
/* is escape sequence */
|
||||
if (input_end[0] == '\\')
|
||||
{
|
||||
if ((size_t)(input_end + 1 - input_buffer->content) >= input_buffer->length)
|
||||
if ((size_t)(input_end + 1 - input_buffer->content) >= input_buffer->length - 1)
|
||||
{
|
||||
/* prevent buffer overflow when last input character is a backslash */
|
||||
goto fail;
|
||||
|
Loading…
Reference in New Issue
Block a user