Files
harfbuzz/test/api
Behdad EsfahbodandClaude Opus 4.8 fd1877fa8b [ft] Make hb_ft_font_set_funcs() a no-op on immutable fonts
hb_ft_font_set_funcs() assumed the FT_Face it creates is adopted by
hb_font_set_funcs(), but on an immutable font that call only runs the
destroy callback, which FT_Done_Face()s the face.  The trailing
_hb_ft_hb_font_changed() then called FT_Set_Char_Size()/FT_Set_Transform()
on freed memory, crashing an application that merely called the setter on
a frozen hb-ft font (e.g. one already passed to
hb_cairo_font_face_create_for_font()).

Add the same early hb_object_is_immutable() return that the sibling setter
hb_ft_font_set_load_flags() and hb_font_set_funcs_using() already have, so
the call fails silently as the object model documents and no
FT_Face/FT_Library reference is created at all.  No change for mutable
fonts; no API/ABI change.

Adds test_native_ft_set_funcs_immutable, which reports the
heap-use-after-free under ASan without the fix and passes with it.

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

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-31 22:45:12 -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-15 13:36:01 -08:00
2025-06-08 13:43:27 +03:00