Files
harfbuzz/src/graph
Behdad Esfahbod f9fcba7272 [repacker] Prevent matrix vertex size checks from wrapping (#6491)
AnchorMatrix's offset array size was multiplied in unsigned arithmetic.
A small vertex with 46341 rows could therefore be accepted as a
46341-column matrix, leading to excessive work and allocation during
subtable splitting. PairPosFormat2 had the same problem on 32-bit
platforms.

Use the existing size_t saturating multiply helper and compare against
the payload length after checking the header. This preserves the width
of PairPosFormat2's size computation and avoids overflow in the header
addition as well.

Add bounded internal vertex tests for wrapping dimensions, exact valid
sizes, truncated payloads and headers, and empty matrices. The anchor
regression fails against the unchanged code without large allocations.

Discovered by Anthropic's OSS Scanner, as vulnerability
ANT-2026-7E6A2QQS.

Testing: meson compile -C build -j4; meson test -C build
(all 274 tests passed).

Assisted-by: OpenAI Codex
2026-10-30 14:51:09 -06:00
..