mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
fix invalid memory access in parse_string
This commit is contained in:
parent
cb8693b058
commit
6dd02df262
2
cJSON.c
2
cJSON.c
@ -778,7 +778,7 @@ static cJSON_bool parse_string(cJSON * const item, parse_buffer * const input_bu
|
|||||||
unsigned char *output = NULL;
|
unsigned char *output = NULL;
|
||||||
|
|
||||||
/* not a string */
|
/* not a string */
|
||||||
if (buffer_at_offset(input_buffer)[0] != '\"')
|
if (cannot_access_at_index(input_buffer, 0) || buffer_at_offset(input_buffer)[0] != '\"')
|
||||||
{
|
{
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user