summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2015-02-06 15:54:00 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2015-03-17 08:00:29 -0700
commit78c2e3d70d29698244f70164428bd2868c0ab34c (patch)
tree459e3eca2d643a4b39d8366f3b77f8b1356db90b
parent2deda9906480f9c8ae07b8c2a5510cc7e4c59a8e (diff)
bdfReadCharacters: bailout if a char's bitmap cannot be read [CVE-2015-1803]
Previously would charge on ahead with a NULL pointer in ci->bits, and then crash later in FontCharInkMetrics() trying to access the bits. Found with afl-1.23b. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org>
-rw-r--r--src/bitmap/bdfread.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bitmap/bdfread.c b/src/bitmap/bdfread.c
index 6387908..1b29b81 100644
--- a/src/bitmap/bdfread.c
+++ b/src/bitmap/bdfread.c
@@ -458,7 +458,10 @@ bdfReadCharacters(FontFilePtr file, FontPtr pFont, bdfFileState *pState,
ci->metrics.descent = -bb;
ci->metrics.characterWidth = wx;
ci->bits = NULL;
- bdfReadBitmap(ci, file, bit, byte, glyph, scan, bitmapsSizes);
+ if (!bdfReadBitmap(ci, file, bit, byte, glyph, scan, bitmapsSizes)) {
+ bdfError("could not read bitmap for character '%s'\n", charName);
+ goto BAILOUT;
+ }
ci++;
ndx++;
} else