Commit acd226d1 authored by Nikias Bassen's avatar Nikias Bassen

plist_data_compare: Make sure to compare the node sizes for integer nodes

Without this check, e.g. the values -1 and 18446744073709551615 would yield in a
match, since the comparison will just compare the uint64_t values. However, any
value >= 9223372036854775808 and <= 18446744073709551615 is stored as a 128 bit
value in binary plist format to make sure it is recognized as an unsigned value.
We store it internally as a uint64_t value, but we set the size to 16 vs. 8
accordingly; so this commit will make sure the binary plist optimization will
not re-use matching uint64_t values of actually mismatching signed/unsigned values.
parent 11d639f9
......@@ -701,6 +701,8 @@ int plist_data_compare(const void *a, const void *b)
case PLIST_UINT:
case PLIST_REAL:
case PLIST_UID:
if (val_a->length != val_b->length)
return FALSE;
if (val_a->intval == val_b->intval) //it is an union so this is sufficient
return TRUE;
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment