Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > 679715925e965bb2a6eb2a4e20fe9b0e > files > 4

libxfont-1.3.0-3.1mdv2008.0.src.rpm

--- libXfont-1.2.2/src/bitmap/pcfread.c.jx	2008-01-14 11:10:38.000000000 -0500
+++ libXfont-1.2.2/src/bitmap/pcfread.c	2008-01-14 11:13:15.000000000 -0500
@@ -585,6 +585,9 @@ pcfReadFont(FontPtr pFont, FontFilePtr f
     pFont->info.lastRow = pcfGetINT16(file, format);
     pFont->info.defaultCh = pcfGetINT16(file, format);
     if (IS_EOF(file)) goto Bail;
+    if (pFont->info.firstCol > pFont->info.lastCol ||
+	pFont->info.firstRow > pFont->info.lastRow ||
+	pFont->info.lastCol-pFont->info.firstCol > 255) goto Bail;
 
     nencoding = (pFont->info.lastCol - pFont->info.firstCol + 1) *
 	(pFont->info.lastRow - pFont->info.firstRow + 1);
@@ -723,6 +726,9 @@ pcfReadFontInfo(FontInfoPtr pFontInfo, F
     pFontInfo->lastRow = pcfGetINT16(file, format);
     pFontInfo->defaultCh = pcfGetINT16(file, format);
     if (IS_EOF(file)) goto Bail;
+    if (pFontInfo->firstCol > pFontInfo->lastCol ||
+	pFontInfo->firstRow > pFontInfo->lastRow ||
+	pFontInfo->lastCol-pFontInfo->firstCol > 255) goto Bail;
 
     nencoding = (pFontInfo->lastCol - pFontInfo->firstCol + 1) *
 	(pFontInfo->lastRow - pFontInfo->firstRow + 1);