Skip to content

Commit 3ef4e4e

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

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cJSON.c

+5
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)