mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-02-16 09:40:31 +01:00
DIX Fix: QueryFontReply packets can be too big to be allocated on the stack
This commit is contained in:
parent
bb8eae78d5
commit
54a552c94e
1 changed files with 4 additions and 4 deletions
|
|
@ -1366,7 +1366,7 @@ ProcQueryFont(register ClientPtr client)
|
|||
rlength = sizeof(xQueryFontReply) +
|
||||
FONTINFONPROPS(FONTCHARSET(pFont)) * sizeof(xFontProp) +
|
||||
nprotoxcistructs * sizeof(xCharInfo);
|
||||
reply = (xQueryFontReply *)ALLOCATE_LOCAL(rlength);
|
||||
reply = (xQueryFontReply *)xalloc(rlength);
|
||||
if(!reply)
|
||||
{
|
||||
return(BadAlloc);
|
||||
|
|
@ -1378,7 +1378,7 @@ ProcQueryFont(register ClientPtr client)
|
|||
QueryFont( pFont, reply, nprotoxcistructs);
|
||||
|
||||
WriteReplyToClient(client, rlength, reply);
|
||||
DEALLOCATE_LOCAL(reply);
|
||||
xfree(reply);
|
||||
return(client->noClientException);
|
||||
}
|
||||
}
|
||||
|
|
@ -2203,7 +2203,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable,
|
|||
length += widthBytesLine;
|
||||
}
|
||||
}
|
||||
if(!(pBuf = (char *) ALLOCATE_LOCAL(length)))
|
||||
if(!(pBuf = (char *)xalloc(length)))
|
||||
return (BadAlloc);
|
||||
WriteReplyToClient(client, sizeof (xGetImageReply), &xgi);
|
||||
}
|
||||
|
|
@ -2312,7 +2312,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable,
|
|||
REGION_DESTROY(pDraw->pScreen, pVisibleRegion);
|
||||
#endif
|
||||
if (!im_return)
|
||||
DEALLOCATE_LOCAL(pBuf);
|
||||
xfree(pBuf);
|
||||
return (client->noClientException);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue