From 9585c38d5a79acc12c79aeca0500810870798e35 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Tue, 27 Jun 2017 23:05:38 +0200 Subject: [PATCH] handle null pointers: cJSON_CreateStringArray --- cJSON.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cJSON.c b/cJSON.c index fd83a2d..ed2246e 100644 --- a/cJSON.c +++ b/cJSON.c @@ -2278,7 +2278,7 @@ CJSON_PUBLIC(cJSON *) cJSON_CreateStringArray(const char **strings, int count) cJSON *p = NULL; cJSON *a = NULL; - if (count < 0) + if ((count < 0) || (strings == NULL)) { return NULL; }