mirror of
https://github.com/DaveGamble/cJSON
synced 2025-05-09 11:37:57 +00:00
handle null pointer: cJSONUtils_FindPointerFromObjectTo
This commit is contained in:
parent
bdd5ff7ad6
commit
9bdf19fde1
@ -162,6 +162,11 @@ CJSON_PUBLIC(char *) cJSONUtils_FindPointerFromObjectTo(const cJSON * const obje
|
|||||||
size_t child_index = 0;
|
size_t child_index = 0;
|
||||||
cJSON *current_child = 0;
|
cJSON *current_child = 0;
|
||||||
|
|
||||||
|
if ((object == NULL) || (target == NULL))
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (object == target)
|
if (object == target)
|
||||||
{
|
{
|
||||||
/* found */
|
/* found */
|
||||||
|
Loading…
Reference in New Issue
Block a user