handle null pointers: cJSON_CreateFloatArray

This commit is contained in:
Max Bruckner 2017-06-27 23:04:47 +02:00
parent 010e31f2f2
commit 9f745a2251

View File

@ -2206,7 +2206,7 @@ CJSON_PUBLIC(cJSON *) cJSON_CreateFloatArray(const float *numbers, int count)
cJSON *p = NULL; cJSON *p = NULL;
cJSON *a = NULL; cJSON *a = NULL;
if (count < 0) if ((count < 0) || (numbers == NULL))
{ {
return NULL; return NULL;
} }