diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2015-02-06 15:54:00 -0800 |
---|---|---|
committer | Mike DePaulo <mikedep333@gmail.com> | 2015-03-28 09:15:32 -0400 |
commit | c833cc9b47becd22b5f6de91d69a467adc57c87d (patch) | |
tree | 40b2306efdfb9c4c7216ace027405fe48b73552b | |
parent | ad956b8d1970952639b87c0b3bae966277fd1a32 (diff) | |
download | vcxsrv-c833cc9b47becd22b5f6de91d69a467adc57c87d.tar.gz vcxsrv-c833cc9b47becd22b5f6de91d69a467adc57c87d.tar.bz2 vcxsrv-c833cc9b47becd22b5f6de91d69a467adc57c87d.zip |
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>
(cherry picked from commit 78c2e3d70d29698244f70164428bd2868c0ab34c)
-rw-r--r-- | libXfont/src/bitmap/bdfread.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libXfont/src/bitmap/bdfread.c b/libXfont/src/bitmap/bdfread.c index 638790854..1b29b81c9 100644 --- a/libXfont/src/bitmap/bdfread.c +++ b/libXfont/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 |