handle null pointer: cJSONUtils_FindPointerFromObjectTo

This commit is contained in:
Max Bruckner 2017-06-28 15:58:22 +02:00
parent bdd5ff7ad6
commit 9bdf19fde1

View File

@ -162,6 +162,11 @@ CJSON_PUBLIC(char *) cJSONUtils_FindPointerFromObjectTo(const cJSON * const obje
size_t child_index = 0;
cJSON *current_child = 0;
if ((object == NULL) || (target == NULL))
{
return NULL;
}
if (object == target)
{
/* found */