Browse Source

handle null pointers: replace_item_in_object

Max Bruckner 8 years ago
parent
commit
8ea37fce01
1 changed files with 1 additions and 1 deletions
  1. 1 1
      cJSON.c

+ 1 - 1
cJSON.c

@@ -2008,7 +2008,7 @@ CJSON_PUBLIC(void) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newi
 
 static cJSON_bool replace_item_in_object(cJSON *object, const char *string, cJSON *replacement, cJSON_bool case_sensitive)
 {
-    if (replacement == NULL)
+    if ((replacement == NULL) || (string == NULL))
     {
         return false;
     }