From 8ea37fce017847372f5bdd144c380b57c023af5d Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Tue, 27 Jun 2017 23:03:59 +0200 Subject: [PATCH] handle null pointers: replace_item_in_object --- cJSON.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cJSON.c b/cJSON.c index 1e9802a..15bd7f8 100644 --- a/cJSON.c +++ b/cJSON.c @@ -2008,7 +2008,7 @@ CJSON_PUBLIC(void) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newi static cJSON_bool replace_item_in_object(cJSON *object, const char *string, cJSON *replacement, cJSON_bool case_sensitive) { - if (replacement == NULL) + if ((replacement == NULL) || (string == NULL)) { return false; }