[cmap] malloc fail test (#5710)

Fixes https://github.com/harfbuzz/harfbuzz/security/advisories/GHSA-xvjr-f2r9-c7ww
This commit is contained in:
Behdad Esfahbod authored and GitHub committed 2026-01-09 04:54:42 -07:00
1 parent fa2908bf16
commit 1265ff8d99
1 file changed
+4
+4
View File
@@ -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;
}