Skip to content

Commit 3ef4e4e

Browse files
orriAlanscut
authored andcommitted
Fix heap buffer overflow
Fixes DaveGamble#800
1 parent 826cd6f commit 3ef4e4e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎cJSON.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,6 +1660,11 @@ static cJSON_bool parse_object(cJSON * const item, parse_buffer * const input_bu
16601660
current_item = new_item;
16611661
}
16621662

1663+
if (cannot_access_at_index(input_buffer, 1))
1664+
{
1665+
goto fail; /* nothing comes after the comma */
1666+
}
1667+
16631668
/* parse the name of the child */
16641669
input_buffer->offset++;
16651670
buffer_skip_whitespace(input_buffer);

0 commit comments

Comments
 (0)