mirror of
https://github.com/DaveGamble/cJSON.git
synced 2026-11-22 20:11:49 +00:00
handle null pointers: cJSON_ReplaceItemViaPointer
This commit is contained in:
1 parent
9585c38d5a
commit
39745c9c75
1 file changed
+1
-1
@@ -1963,7 +1963,7 @@ CJSON_PUBLIC(void) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newit
|
|||||||
|
|
||||||
CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement)
|
CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement)
|
||||||
{
|
{
|
||||||
if ((parent == NULL) || (replacement == NULL))
|
if ((parent == NULL) || (replacement == NULL) || (item == NULL))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user