From 1265ff8d990284f04d8768f35b0e20ae5f60daae Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 9 Jan 2026 04:54:42 -0700 Subject: [PATCH] [cmap] malloc fail test (#5710) Fixes https://github.com/harfbuzz/harfbuzz/security/advisories/GHSA-xvjr-f2r9-c7ww --- src/hb-ot-cmap-table.hh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh index 32f705bb3..d08e66eda 100644 --- a/src/hb-ot-cmap-table.hh +++ b/src/hb-ot-cmap-table.hh @@ -1670,6 +1670,10 @@ struct SubtableUnicodesCache { { SubtableUnicodesCache* cache = (SubtableUnicodesCache*) hb_malloc (sizeof(SubtableUnicodesCache)); + + if (unlikely (!cache)) + return nullptr; + new (cache) SubtableUnicodesCache (source_table); return cache; }