diff options
author | Ben Byer <bbyer@bbyer.apple.com> | 2007-10-30 20:00:21 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremy@yuffie.local> | 2007-11-20 03:18:42 -0800 |
commit | d01986d5a955f7a6973291d630e0ac379ef068b1 (patch) | |
tree | 84ddf61be6a124d2c555305f2c428298fb39e9c0 /dix | |
parent | 65c67205fde68411582d3af1e7b700ffde7b1f53 (diff) |
DIX Fix: QueryFontReply packets can be too big to be allocated on the stack
Diffstat (limited to 'dix')
-rw-r--r-- | dix/dispatch.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/dix/dispatch.c b/dix/dispatch.c index c313796ab..b4e8787d2 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -1402,7 +1402,7 @@ ProcQueryFont(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); @@ -1414,7 +1414,7 @@ ProcQueryFont(ClientPtr client) QueryFont( pFont, reply, nprotoxcistructs); WriteReplyToClient(client, rlength, reply); - DEALLOCATE_LOCAL(reply); + xfree(reply); return(client->noClientException); } } @@ -2260,7 +2260,7 @@ DoGetImage(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); } @@ -2362,7 +2362,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable, if (pVisibleRegion) REGION_DESTROY(pDraw->pScreen, pVisibleRegion); if (!im_return) - DEALLOCATE_LOCAL(pBuf); + xfree(pBuf); return (client->noClientException); } |