BTL found the issue with proplist.c: When the number of required array elements are counted, the 3 excluded mandatory properties are subtracted from ”count”, but ”count” is later overwritten, causing the encoded to miss the ”correct by 3” part of the code. - Thank you, Rasmus B. Nielsen!

This commit is contained in:
skarg
2016-01-21 17:35:40 +00:00
parent be74823235
commit 0f2399fd21
+4 -6
View File
@@ -1175,16 +1175,14 @@ int property_list_encode(
unsigned i = 0; /* loop index */
required_count = property_list_count(pListRequired);
if (required_count >= 3) {
/* less the 3 always required properties */
count -= 3;
} else {
count = 0;
}
optional_count = property_list_count(pListOptional);
proprietary_count = property_list_count(pListProprietary);
/* total of all counts */
count = required_count + optional_count + proprietary_count;
if (required_count >= 3) {
/* less the 3 always required properties */
count -= 3;
}
if ((rpdata == NULL) || (rpdata->application_data == NULL) ||
(rpdata->application_data_len == 0)) {
return 0;