/[gentoo-x86]/x11-base/xorg-server/files/xorg-xserver-1.2.0-xcmisc.diff
Gentoo

Contents of /x11-base/xorg-server/files/xorg-xserver-1.2.0-xcmisc.diff

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Thu Jan 17 21:31:41 2008 UTC (6 years, 11 months ago) by dberkholz
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
File MIME type: text/plain
FILE REMOVED
Security cleanup. Still waiting on mips/sh/arm to stable 1.3.0.0-r3 before I can pull -r2.
(Portage version: 2.1.4)

1 diff --git a/Xext/xcmisc.c b/Xext/xcmisc.c
2 index f26218e..8c7a86e 100644
3 --- a/Xext/xcmisc.c
4 +++ b/Xext/xcmisc.c
5 @@ -42,6 +42,12 @@ #include "swaprep.h"
6 #include <X11/extensions/xcmiscstr.h>
7 #include "modinit.h"
8
9 +#if HAVE_STDINT_H
10 +#include <stdint.h>
11 +#elif !defined(UINT32_MAX)
12 +#define UINT32_MAX 0xffffffffU
13 +#endif
14 +
15 #if 0
16 static unsigned char XCMiscCode;
17 #endif
18 @@ -143,7 +149,10 @@ ProcXCMiscGetXIDList(client)
19
20 REQUEST_SIZE_MATCH(xXCMiscGetXIDListReq);
21
22 - pids = (XID *)ALLOCATE_LOCAL(stuff->count * sizeof(XID));
23 + if (stuff->count > UINT32_MAX / sizeof(XID))
24 + return BadAlloc;
25 +
26 + pids = (XID *)Xalloc(stuff->count * sizeof(XID));
27 if (!pids)
28 {
29 return BadAlloc;
30 @@ -164,7 +173,7 @@ ProcXCMiscGetXIDList(client)
31 client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
32 WriteSwappedDataToClient(client, count * sizeof(XID), pids);
33 }
34 - DEALLOCATE_LOCAL(pids);
35 + Xfree(pids);
36 return(client->noClientException);
37 }
38

  ViewVC Help
Powered by ViewVC 1.1.20