diff --git a/cJSON.c b/cJSON.c index 54e18375cd980af119391aca88438c584213d58c..62ddb99583be5cd4cd9b8a83c7b25a0794eac9d3 100644 --- a/cJSON.c +++ b/cJSON.c @@ -1655,6 +1655,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);