Files
harfbuzz/test/api
Behdad EsfahbodandClaude Opus 4.8 db0231fc12 [subset] Free the replaced override string in override_name_table()
name_table_overrides stores hb_malloc()ed strings as plain hb_bytes_t
values, so the invariant that every stored string is freed exactly once
in ~hb_subset_input_t broke when set() silently overwrote an existing
key: overriding the same name record more than once on one input leaked
the previous copy, and so did a NULL (remove) after a non-empty
override.

hb_subset_input_override_name_table() is the only place that allocates
these strings, so fix it there: look the record up with has(&old) and
fini() it in place before set() (fini nulls the pair, so no path frees
twice, and the lookup happens before set() can reallocate the table).
Also free the fresh copy and return false when set() cannot store it,
instead of leaking it and returning true.  hb_subset_plan_t copies the
map and frees its own copies, so it is unaffected.  No public API/ABI
change.

A regression line in test_subset_name_overrides overrides one record
twice; only the last string survives and the first must not leak.

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

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-30 15:26:52 -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