Add underflow detection to TTF cmap code.

This commit is contained in:
Michael R Sweet
2025-08-27 11:19:35 -04:00
parent ccf3a90c97
commit 359b65298e
2 changed files with 7 additions and 1 deletions

2
ttf.c
View File

@@ -1379,7 +1379,7 @@ read_cmap(ttf_t *font) // I - Font
/* language = */ read_ushort(font);
if (length > (256 + 6))
if (length > (256 + 6) || length < 7)
{
errorf(font, "Bad cmap table length at offset %u.", coffset);
return (false);