소스 검색

handle null pointers: cJSON_CreateIntArray

Max Bruckner 8 년 전
부모
커밋
010e31f2f2
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      cJSON.c

+ 1 - 1
cJSON.c

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