From 9bdf19fde1cc2e61c2f6820f891b9cdca772d10c Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Wed, 28 Jun 2017 15:58:22 +0200 Subject: [PATCH] handle null pointer: cJSONUtils_FindPointerFromObjectTo --- cJSON_Utils.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cJSON_Utils.c b/cJSON_Utils.c index c0fd649..01cad63 100644 --- a/cJSON_Utils.c +++ b/cJSON_Utils.c @@ -162,6 +162,11 @@ CJSON_PUBLIC(char *) cJSONUtils_FindPointerFromObjectTo(const cJSON * const obje size_t child_index = 0; cJSON *current_child = 0; + if ((object == NULL) || (target == NULL)) + { + return NULL; + } + if (object == target) { /* found */