Files
harfbuzz/test/api
Behdad EsfahbodandClaude Opus 4.8 5ef8ef9281 [kerx] Charge format-4 control-point actions' contour-point lookups to max_ops
A kerx format-4 control-point action asks the font for two glyph
contour points, which the font functions may satisfy by loading the
whole glyph outline (two full FT_Load_Glyph calls with hb-ft).  The
state-machine driver charges a non-advancing transition only one op,
so a looping entry turned the whole work budget into glyph loads:
two letters and a 680-byte font stalled hb_shape() for seconds.

Charge 2 * HB_BUDGET_256 to buffer->max_ops at the action, before the
callbacks, using the same decrement-and-return idiom morx insertion
uses; once the budget is spent the action is skipped and the driver's
existing max_ops check forces the machine forward.

The sibling GPOS AnchorFormat2 contour-point path has the same
uncharged callback but lives in the layout subsystem and is left for
a separate change.  GDEF CaretValueFormat2 also calls it but only
from hb_ot_layout_get_ligature_carets, bounded per API call.

Regression test in test/api/test-shape.c uses a counting
glyph_contour_point callback on a builder-made looping kerx font
(131074 calls before, <= 256 after).

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

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-02 10:52:07 -06:00
..
2025-04-06 18:08:50 -06:00
2026-07-30 19:02:25 -06:00
2026-07-31 04:31:26 +03:00
2025-04-05 22:37:10 -06:00
2020-01-15 13:36:01 -08:00
2025-06-08 13:43:27 +03:00