Skip to content

Commit

Permalink
Fix for CVE-2008-0006 - PCF Font parser buffer overflow.
Browse files Browse the repository at this point in the history
(cherry picked from commit f09b800)
  • Loading branch information
Matthieu Herrb authored and Jeremy Huddleston committed Jan 17, 2008
1 parent 0dbe1a0 commit 73abb37
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dix/dixfonts.c
Expand Up @@ -329,6 +329,13 @@ doOpenFont(ClientPtr client, OFclosurePtr c)
err = BadFontName;
goto bail;
}
/* check values for firstCol, lastCol, firstRow, and lastRow */
if (pfont->info.firstCol > pfont->info.lastCol ||
pfont->info.firstRow > pfont->info.lastRow ||
pfont->info.lastCol - pfont->info.firstCol > 255) {
err = AllocError;
goto bail;
}
if (!pfont->fpe)
pfont->fpe = fpe;
pfont->refcnt++;
Expand Down

0 comments on commit 73abb37

Please sign in to comment.