22a20cd
diff -up xorg-x11-6.8.2/xc/programs/Xserver/dix/dixfonts.c.jx xorg-x11-6.8.2/xc/programs/Xserver/dix/dixfonts.c
22a20cd
--- xorg-x11-6.8.2/xc/programs/Xserver/dix/dixfonts.c.jx	2004-04-23 15:04:44.000000000 -0400
22a20cd
+++ xorg-x11-server/dix/dixfonts.c	2008-01-14 11:15:00.000000000 -0500
22a20cd
@@ -339,6 +339,13 @@ doOpenFont(ClientPtr client, OFclosurePt
22a20cd
 	err = BadFontName;
22a20cd
 	goto bail;
22a20cd
     }
22a20cd
+    /* check values for firstCol, lastCol, firstRow, and lastRow */
22a20cd
+    if (pfont->info.firstCol > pfont->info.lastCol ||
22a20cd
+	pfont->info.firstRow > pfont->info.lastRow ||
22a20cd
+	pfont->info.lastCol - pfont->info.firstCol > 255) {
22a20cd
+	err = AllocError;
22a20cd
+	goto bail;
22a20cd
+    }
22a20cd
     if (!pfont->fpe)
22a20cd
 	pfont->fpe = fpe;
22a20cd
     pfont->refcnt++;