Commit Graph
7 Commits
Author SHA1 Message Date
Behdad Esfahbod 21a2f7c43e [repacker] Reject output sizes that cannot fit a blob (#6478)
The graph total is size_t, while the output vector allocation takes an
unsigned int. Check the total against the blob length limit before that
conversion, so the allocation and serialization context use the same
size. Totals above INT_MAX cannot produce a valid output blob anyway.

Add a public-API regression whose objects share their backing storage,
keeping its memory use small while exercising a large graph total.

Testing: meson test -C build (292 passed; check-symbols skipped on
macOS), plus test-subset-repacker with ASan and UBSan. The regression
reproduces the invalid write without the check and fails cleanly with it.

Discovered by Anthropic's OSS Scanner, as vulnerability
ANT-2026-4Q0YO46E.

Assisted-by: OpenAI Codex
2026-10-29 20:56:03 -06:00
Behdad Esfahbod 41ec50d54b [subset] Include serialize API from subset header
The subset umbrella header already carries the public subset API, but it
missed hb-subset-serialize.h even though the serialize symbols are part
of the subset section. Include the serialize header from hb-subset.h so
users can get the API through the top-level subset header.

Keep hb-subset-serialize.h directly includable for compatibility, but
emit a diagnostic asking users to include hb-subset.h instead. Update the
local repacker tests to use the umbrella header and verify the API is
available there.

Testing: meson compile -C build test/api/test-subset-repacker test/fuzzing/hb-repacker-fuzzer
Testing: meson test -C build --suite api
Testing: meson test -C build

Assisted-by: OpenAI Codex
2026-07-14 12:01:38 -06:00
Behdad Esfahbod f69ecc9438 [test/api] Set protocol:tap 2025-04-06 02:34:48 -06:00
Garret Rieger bdb50f1c6e [repacker] Also rename api method from hb_subset_repack_or_fail -> hb_subset_serialize_or_fail. 2025-01-07 13:39:51 -07:00
Garret Rieger 056504168c [repacker] rename hb-subset-repacker -> hb-subset-serialize.
Also hb_link_t and hb_object_t to hb_subset_serialize_link_t and hb_subset_serialize_object_t.
2025-01-07 13:39:51 -07:00
Garret Rieger f3aff45e04 [repacker] Update call to hb_subset_repack_or_fail in tests. 2022-07-29 16:16:46 -06:00
Qunxin Liu a35757c6bc [repacker] expose hb_subset_repack() API, hb_object_t and hb_link_t structs 2022-03-10 17:26:20 -07:00