diff options
| author | 2026-11-05 10:40:10 +0100 | |
|---|---|---|
| committer | 2026-11-05 10:40:10 +0100 | |
| commit | 40666fa02457c84c3b8561b2bb36928bd23e9f04 (patch) | |
| tree | 16413866a11593acbac246316e79fb7c6f3e8a0f /libcnary/README | |
| parent | 2b3cc554270d34ca1e1fae3eb2cbbc740a65bbf3 (diff) | |
| download | libplist-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 'libcnary/README')
0 files changed, 0 insertions, 0 deletions
