summaryrefslogtreecommitdiffstats
path: root/test/ostep-invalid-types.test
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2026-11-05 10:40:10 +0100
committerGravatar Nikias Bassen2026-11-05 10:40:10 +0100
commit40666fa02457c84c3b8561b2bb36928bd23e9f04 (patch)
tree16413866a11593acbac246316e79fb7c6f3e8a0f /test/ostep-invalid-types.test
parent2b3cc554270d34ca1e1fae3eb2cbbc740a65bbf3 (diff)
downloadlibplist-40666fa02457c84c3b8561b2bb36928bd23e9f04.tar.gz
libplist-40666fa02457c84c3b8561b2bb36928bd23e9f04.tar.bz2
bytearray: grow buffer geometrically to avoid quadratic appends
byte_array_grow() increased the capacity by a single page at a time, so building large outputs (e.g. the plutil writer on a plist with heavily shared references) caused a realloc and memcpy per page, i.e. quadratic behavior that ran into fuzzer timeouts. Double the capacity when growing. If the larger allocation fails, fall back to the minimum size required before putting the array into its failed state, so low-memory systems are not penalized by the extra headroom. Also guard against size_t overflow in the capacity arithmetic.
Diffstat (limited to 'test/ostep-invalid-types.test')
0 files changed, 0 insertions, 0 deletions