mirror of
https://github.com/DaveGamble/cJSON.git
synced 2026-11-22 20:11:49 +00:00
handle null pointers: replace_item_in_object
This commit is contained in:
1 parent
b2fe02712d
commit
8ea37fce01
1 file changed
+1
-1
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user