diff options
| author | 2026-10-17 20:14:17 -0400 | |
|---|---|---|
| committer | 2026-11-05 23:46:59 +0100 | |
| commit | 86def304f2915a13170bd0ff7adf0816ab3178a6 (patch) | |
| tree | 7b06da07ebba7c91a87728543a9d01b6b71e2e51 /fuzz/plist_write_fuzzer.cc | |
| parent | 9d238e5e1a55a126c8d19d644a5a2a9c305eb564 (diff) | |
| download | libplist-86def304f2915a13170bd0ff7adf0816ab3178a6.tar.gz libplist-86def304f2915a13170bd0ff7adf0816ab3178a6.tar.bz2 | |
bplist: Use length-based range checks for object data
The binary plist parser validated object data by computing pointers such
as `object + size` or `refs + j * ref_size` and comparing them against the
offset table. Each of these checks had to be written with its own
wrap-around handling, and the pointer was formed before it was known to
be inside the input buffer.
Add bplist_object_range_valid(), which checks a length against the bytes
remaining before the offset table, and bplist_read_object_ref(), which
reads an array/dict object reference with an overflow-checked offset.
Use them for all object data checks in parse_bin_node() and for the
reference reads in parse_array_node() and parse_dict_node(). Arrays and
dicts now validate the full reference list (count * ref_size, or twice
that for dicts) up front instead of only the item count.
The node offset checks in parse_bin_node_at_index() and the offset table
check in plist_from_bin() compare offsets instead of pointers as well.
Valid binary plists are parsed exactly as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'fuzz/plist_write_fuzzer.cc')
0 files changed, 0 insertions, 0 deletions
