handle null pointers: cJSON_CreateDoubleArray

This commit is contained in:
Max Bruckner 2017-06-27 23:05:16 +02:00
parent 9f745a2251
commit c268e77b21

View File

@ -2242,7 +2242,7 @@ CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *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;
} }