handle null pointers: replace_item_in_object

This commit is contained in:
Max Bruckner 2017-06-27 23:03:59 +02:00
parent b2fe02712d
commit 8ea37fce01

View File

@ -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) 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; return false;
} }