cJSON

mirror of Dave's cJSON
git clone git://git.thc420.xyz/cJSON
Log | Files | Refs | README | LICENSE

commit 795c3acabed25c9672006b2c0f40be8845064827
parent 2683d4d9873df87c4bdccc523903ddd78d1ad250
Author: Max Bruckner <max@maxbruckner.de>
Date:   Wed,  5 Apr 2017 17:36:25 +0200

cJSON_Utils: Fix potential null pointer dereference

Found by coverity

Diffstat:
McJSON_Utils.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cJSON_Utils.c b/cJSON_Utils.c @@ -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);