1
0
mirror of https://github.com/DaveGamble/cJSON synced 2024-12-26 08:32:04 +00:00

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 *a = NULL;
if (count < 0)
if ((count < 0) || (numbers == NULL))
{
return NULL;
}