Files
harfbuzz/test/api
nussaiba shaikh d2202126e2 Read 24-bit coverage offsets in ContextFormat3_6::depend
ContextFormat3_6<MediumTypes> (context format 6) stores its input
Coverage offsets as Offset24, but depend() passed them to
context_depend_lookup() cast to HBUINT16, so every input position
after the first decoded the wrong bytes as its offset.
intersects_coverage() then followed that value to a Coverage table
sanitize never checked.

With small offsets the misread value is 0, which points at the
subtable header, and the nested lookup's dependencies are silently
dropped.  A crafted rule can instead point the misread offset at bytes
shaped like a large Coverage, and CoverageFormat1_3::intersects() reads
past the end of the GSUB blob (ASan heap-buffer-overflow via
hb_subset_depend_from_face_or_fail).

The other ContextFormat3_6 methods pass coverageZ.arrayZ + 1 as is and
let glyph_data_t pick the width.  Do the same here.
ChainContextFormat3 has the same cast but only has a 16-bit
instantiation.

Add a format 6 font and test to test-ot-depend.c; it fails without
the fix.  Tested with meson test under ASan+UBSan with
-Dexperimental_api=true.

Assisted-by: Claude
2026-10-28 00:03:22 +05:30
..
2025-04-06 18:08:50 -06:00
2026-07-30 19:02:25 -06:00
2026-09-04 14:14:49 -06:00
2026-07-31 04:31:26 +03:00
2025-04-05 22:37:10 -06:00
2020-01-31 16:37:30 -05:00
2020-01-15 13:36:01 -08:00
2025-06-08 13:43:27 +03:00