diff --git a/cJSON.c b/cJSON.c index 8411d9477b8a04c6f3e60d182eec6be6b2cb48a6..3a7219ae2a9a6bf73480f589a4756164d2120ff1 100644 --- a/cJSON.c +++ b/cJSON.c @@ -1659,6 +1659,11 @@ static cJSON_bool parse_object(cJSON * const item, parse_buffer * const input_bu current_item = new_item; } + if (cannot_access_at_index(input_buffer, 1)) + { + goto fail; /* nothing comes after the comma */ + } + /* parse the name of the child */ input_buffer->offset++; buffer_skip_whitespace(input_buffer);