From 46c4f55c94e836ffffc892875549745c9627f2c6 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Tue, 27 Jun 2017 23:01:38 +0200 Subject: [PATCH] handle null pointers: cJSON_AddItemToObjectCS --- cJSON.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cJSON.c b/cJSON.c index 3bf109b..5d3c4a7 100644 --- a/cJSON.c +++ b/cJSON.c @@ -1826,7 +1826,7 @@ CJSON_PUBLIC(void) cJSON_AddItemToObject(cJSON *object, const char *string, cJSO /* Add an item to an object with constant string as key */ CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item) { - if (!item) + if ((item == NULL) || (string == NULL)) { return; }