From 010e31f2f259f7627e8dd81023d6df8bb9c125e5 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Tue, 27 Jun 2017 23:04:28 +0200 Subject: [PATCH] handle null pointers: cJSON_CreateIntArray --- cJSON.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cJSON.c b/cJSON.c index 15bd7f8..6021cad 100644 --- a/cJSON.c +++ b/cJSON.c @@ -2171,7 +2171,7 @@ CJSON_PUBLIC(cJSON *) cJSON_CreateIntArray(const int *numbers, int count) cJSON *p = NULL; cJSON *a = NULL; - if (count < 0) + if ((count < 0) || (numbers == NULL)) { return NULL; }