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