Add missing length check

This commit is contained in:
Jonas Möller 2023-03-13 21:11:17 +01:00
parent b45f48e600
commit 8601838022

View File

@ -778,6 +778,11 @@ static cJSON_bool parse_string(cJSON * const item, parse_buffer * const input_bu
unsigned char *output = NULL;
/* not a string */
if (!can_access_at_index(input_buffer, 0))
{
goto fail;
}
if (buffer_at_offset(input_buffer)[0] != '\"')
{
goto fail;