diff --git a/cJSON.c b/cJSON.c index a7379df5296cb0e5bf2d56e24231d2e80106e50d..8e62531e3fb923643662f7a042b037ccf3c4146a 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);