Skip to content

Commit

Permalink
cJSON_Utils: Fix potential null pointer dereference
Browse files Browse the repository at this point in the history
Found by coverity
  • Loading branch information
FSMaxB committed Apr 5, 2017
1 parent 2683d4d commit 795c3ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cJSON_Utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ static int cJSONUtils_ApplyPatch(cJSON *object, cJSON *patch)
cJSONUtils_InplaceDecodePointerString(childptr);

/* add, remove, replace, move, copy, test. */
if (!parent)
if ((parent == NULL) || (childptr == NULL))
{
/* Couldn't find object to add to. */
free(parentptr);
Expand Down

0 comments on commit 795c3ac

Please sign in to comment.