cJSON_Utils: Fix get_item_from_pointer

Accessing nested arrays didn't work as intended.
This commit is contained in:
Max Bruckner 2017-06-14 17:20:12 +02:00
parent 9189b3322a
commit 9abe75e072
1 changed files with 6 additions and 5 deletions

View File

@ -279,16 +279,17 @@ static cJSON *get_item_from_pointer(cJSON * const object, const char * pointer,
{
current_element = current_element->next;
}
/* skip to the next path token or end of string */
while ((pointer[0] != '\0') && (pointer[0] != '/'))
{
pointer++;
}
}
else
{
return NULL;
}
/* skip to the next path token or end of string */
while ((pointer[0] != '\0') && (pointer[0] != '/'))
{
pointer++;
}
}
return current_element;