Skip to content

Commit

Permalink
fix error in null checkings (#810)
Browse files Browse the repository at this point in the history
fixes #802 and #803
  • Loading branch information
PeterAlfredLee committed Dec 20, 2023
1 parent 60ff122 commit f66cbab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cJSON.c
Original file line number Diff line number Diff line change
Expand Up @@ -2280,7 +2280,7 @@ CJSON_PUBLIC(cJSON_bool) cJSON_InsertItemInArray(cJSON *array, int which, cJSON
return add_item_to_array(array, newitem);
}

if (after_inserted != array->child && newitem->prev == NULL) {
if (after_inserted != array->child && after_inserted->prev == NULL) {
/* return false if after_inserted is a corrupted array item */
return false;
}
Expand Down

0 comments on commit f66cbab

Please sign in to comment.