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