diff options
author | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2007-04-05 14:41:39 -0400 |
---|---|---|
committer | Eamon Walsh <ewalsh@moss-uranus.epoch.ncsc.mil> | 2007-04-05 14:41:39 -0400 |
commit | cf962a849db2b259ca558c6265ea7e3328a4d312 (patch) | |
tree | 826dcd8d7f7043a8ebc611aebd10978d2550d7f5 /Xext | |
parent | 5ad562565ac8ef9257da3afb0de1ae4f90f80fe9 (diff) | |
parent | 5a804f2e97ab59745482660a635b801ac2b9e769 (diff) |
Merge branch 'master' into XACE-SELINUX
Conflicts:
configure.ac
Diffstat (limited to 'Xext')
-rw-r--r-- | Xext/xcmisc.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Xext/xcmisc.c b/Xext/xcmisc.c index f26218e97..8c7a86e6a 100644 --- a/Xext/xcmisc.c +++ b/Xext/xcmisc.c @@ -42,6 +42,12 @@ from The Open Group. #include <X11/extensions/xcmiscstr.h> #include "modinit.h" +#if HAVE_STDINT_H +#include <stdint.h> +#elif !defined(UINT32_MAX) +#define UINT32_MAX 0xffffffffU +#endif + #if 0 static unsigned char XCMiscCode; #endif @@ -143,7 +149,10 @@ ProcXCMiscGetXIDList(client) REQUEST_SIZE_MATCH(xXCMiscGetXIDListReq); - pids = (XID *)ALLOCATE_LOCAL(stuff->count * sizeof(XID)); + if (stuff->count > UINT32_MAX / sizeof(XID)) + return BadAlloc; + + pids = (XID *)Xalloc(stuff->count * sizeof(XID)); if (!pids) { return BadAlloc; @@ -164,7 +173,7 @@ ProcXCMiscGetXIDList(client) client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, count * sizeof(XID), pids); } - DEALLOCATE_LOCAL(pids); + Xfree(pids); return(client->noClientException); } |