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
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