Skip to content

Commit

Permalink
Fix heap buffer overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sbvoxel committed Apr 30, 2024
1 parent 56cdcee commit fba187a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cJSON.c
Original file line number Diff line number Diff line change
Expand Up @@ -1660,6 1660,10 @@ static cJSON_bool parse_object(cJSON * const item, parse_buffer * const input_bu
current_item = new_item;
}

if (input_buffer->offset 1 >= input_buffer->length) {
goto fail; /* nothing comes after the comma */
}

/* parse the name of the child */
input_buffer->offset ;
buffer_skip_whitespace(input_buffer);
Expand Down

0 comments on commit fba187a

Please sign in to comment.