cJSON_Compare: Fix comparison of arrays

It did consider two arrays equal if one is a prefix of the other one,
which is incorrect.

See #180
This commit is contained in:
Max Bruckner
2017-06-13 08:39:18 +02:00
parent b9cc911831
commit 569aa060c6
2 changed files with 9 additions and 0 deletions

View File

@ -2594,6 +2594,11 @@ CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * cons
b_element = b_element->next;
}
/* one of the arrays is longer than the other */
if (a_element != b_element) {
return false;
}
return true;
}