mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-04-17 11:30:45 +02:00
CVE-2008-2360 - RENDER Extension heap buffer overflow
An integer overflow may occur in the computation of the size of the glyph to be allocated by the AllocateGlyph() function which will cause less memory to be allocated than expected, leading to later heap overflow.
This commit is contained in:
parent
8259d19f71
commit
f7c40a003d
1 changed files with 9 additions and 2 deletions
|
|
@ -1117,9 +1117,16 @@ ProcRenderAddGlyphs (ClientPtr client)
|
|||
remain -= (sizeof (CARD32) + sizeof (xGlyphInfo)) * nglyphs;
|
||||
for (i = 0; i < nglyphs; i++)
|
||||
{
|
||||
size_t padded_width;
|
||||
glyph_new = &glyphs[i];
|
||||
size = gi[i].height * PixmapBytePad (gi[i].width,
|
||||
glyphSet->format->depth);
|
||||
|
||||
padded_width = PixmapBytePad (gi[i].width,
|
||||
glyphSet->format->depth);
|
||||
|
||||
if (gi[i].height && padded_width > (UINT32_MAX - sizeof(GlyphRec))/gi[i].height)
|
||||
break;
|
||||
|
||||
size = gi[i].height * padded_width;
|
||||
if (remain < size)
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue