mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
handle null pointers: replace_item_in_object
This commit is contained in:
parent
b2fe02712d
commit
8ea37fce01
2
cJSON.c
2
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user