Commit a0bed4d9 authored by Mike DePaulo's avatar Mike DePaulo Committed by Mike Gabriel

CVE-2014-0211: integer overflow in fs_alloc_glyphs() from xorg/lib/libXfont…

CVE-2014-0211: integer overflow in fs_alloc_glyphs() from xorg/lib/libXfont commit a42f707f8a62973f5e8bbcd08afb10a79e9cee33 fs_alloc_glyphs() is a malloc wrapper used by the font code. It contains a classic integer overflow in the malloc() call, which can cause memory corruption.
parent bb7abd9d
...@@ -762,7 +762,12 @@ fs_alloc_glyphs (FontPtr pFont, int size) ...@@ -762,7 +762,12 @@ fs_alloc_glyphs (FontPtr pFont, int size)
FSGlyphPtr glyphs; FSGlyphPtr glyphs;
FSFontPtr fsfont = (FSFontPtr) pFont->fontPrivate; FSFontPtr fsfont = (FSFontPtr) pFont->fontPrivate;
glyphs = xalloc (sizeof (FSGlyphRec) + size); if (size < (INT_MAX - sizeof (FSGlyphRec)))
glyphs = xalloc (sizeof (FSGlyphRec) + size);
else
glyphs = NULL;
if (glyphs == NULL)
return NULL;
glyphs->next = fsfont->glyphs; glyphs->next = fsfont->glyphs;
fsfont->glyphs = glyphs; fsfont->glyphs = glyphs;
return (pointer) (glyphs + 1); return (pointer) (glyphs + 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment