Add underflow detection to TTF cmap code.

This commit is contained in:
Michael R Sweet
2025-08-27 11:21:16 -04:00
parent dc584c0868
commit 410e3b92ea
2 changed files with 7 additions and 1 deletions

View File

@@ -2,6 +2,12 @@ Changes in PDFio
================
v1.5.5 - YYYY-MM-DD
-------------------
- Fixed TTF cmap underflow error.
v1.5.4 - 2025-08-26
-------------------

2
ttf.c
View File

@@ -1205,7 +1205,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);