mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-22 15:31:05 +01:00
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