Files
harfbuzz/test/api
Behdad EsfahbodandClaude Opus 4.8 b32bfc243d [graphite2] Initialize mask of glyphs the shaper adds
_hb_graphite2_shape() grows buffer->info with ensure() (a plain
realloc) and then fills each output glyph field by field, but never
assigned hb_glyph_info_t::mask.  Entries beyond the original text
length therefore kept uninitialised heap bytes (or, in a reused
buffer, the mask from a previous shaping run); clear_glyph_flags()
only rewrites the low three bits, so hb_buffer_get_glyph_infos()
handed the stale bits 3-31 to the caller.  Shaping output is correct
(every in-tree reader masks down to HB_GLYPH_FLAG_DEFINED), but
valgrind/MSan flag the uninitialised bytes and code reading the
private field sees values that vary run to run.

Set info->mask = 0 in the fill loop, next to the other fields.  That
matches what hb_buffer_t::add() starts from and what the OpenType
shaper returns after hb_propagate_flags(), so the subsequent
clear_glyph_flags()/unsafe_to_break() operate on a defined value and
shaping output is unchanged.  No other shaper needs the change.

Adds test_graphite2_inserted_glyph_masks, which first runs the
OpenType shaper so a removed default-ignorable leaves a non-zero mask
in the buffer storage, then checks that every glyph the Graphite
shaper adds for U+0622 comes back with nothing but glyph-flag bits.

Reported by Anthropic's OSS Scanner as ordinary bug ANT-2026-UDVJURW0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-30 16:58:47 -06:00
..
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