aboutsummaryrefslogtreecommitdiff
path: root/libX11/include
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-03-11 09:17:45 +0100
committermarha <marha@users.sourceforge.net>2013-04-11 11:13:33 +0200
commita2ce004b2966da2fe0249e72e2fb99255cef3092 (patch)
treec129fd586c3be01193bd767fb9f6db5d49ed1bfe /libX11/include
parentfb84fb26466262dcab4bd31bdf51c982f14f891a (diff)
downloadvcxsrv-a2ce004b2966da2fe0249e72e2fb99255cef3092.tar.gz
vcxsrv-a2ce004b2966da2fe0249e72e2fb99255cef3092.tar.bz2
vcxsrv-a2ce004b2966da2fe0249e72e2fb99255cef3092.zip
fontconfig libX11 mesa pixman xserver xkeyboard-config git update 11 Mar
2013 xserver commit 5047810a4c20fab444b8c6eb146c55dcdb0d4219 xkeyboard-config commit 2ed85c1e936f7cd4a9540ace5c12b9fec60ee1fb libX11 commit 3996543c1b2919e97d61a5d70fe1ebd7cd76fc83 pixman commit aaae3d8eefa069098e9014822817ca1429fdea46 fontconfig commit bdf1581e3de5528f397f19bfd4ca9caaf9e7fe4a mesa commit b21a9d46e4be0c666327569f07b9cddeb4d42d38
Diffstat (limited to 'libX11/include')
-rw-r--r--libX11/include/X11/Xlibint.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/libX11/include/X11/Xlibint.h b/libX11/include/X11/Xlibint.h
index 40965c449..06395b32e 100644
--- a/libX11/include/X11/Xlibint.h
+++ b/libX11/include/X11/Xlibint.h
@@ -486,6 +486,14 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len);
req = (xReq *) _XGetRequest(dpy, X_/**/name, SIZEOF(xReq))
#endif
+/*
+ * MakeBigReq sets the CARD16 "req->length" to 0 and inserts a new CARD32
+ * length, after req->length, before the data in the request. The new length
+ * includes the "n" extra 32-bit words.
+ *
+ * Do not use MakeBigReq if there is no data already in the request.
+ * req->length must already be >= 2.
+ */
#ifdef LONG64
#define MakeBigReq(req,n) \
{ \
@@ -493,7 +501,7 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len);
CARD32 _BRlen = req->length - 1; \
req->length = 0; \
_BRdat = ((CARD32 *)req)[_BRlen]; \
- memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
+ memmove(((char *)req) + 8, ((char *)req) + 4, (_BRlen - 1) << 2); \
((CARD32 *)req)[1] = _BRlen + n + 2; \
Data32(dpy, &_BRdat, 4); \
}
@@ -504,12 +512,19 @@ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len);
CARD32 _BRlen = req->length - 1; \
req->length = 0; \
_BRdat = ((CARD32 *)req)[_BRlen]; \
- memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
+ memmove(((char *)req) + 8, ((char *)req) + 4, (_BRlen - 1) << 2); \
((CARD32 *)req)[1] = _BRlen + n + 2; \
Data32(dpy, &_BRdat, 4); \
}
#endif
+/*
+ * SetReqLen increases the count of 32-bit words in the request by "n",
+ * or by "badlen" if "n" is too large.
+ *
+ * Do not use SetReqLen if "req" does not already have data after the
+ * xReq header. req->length must already be >= 2.
+ */
#ifndef __clang_analyzer__
#define SetReqLen(req,n,badlen) \
if ((req->length + n) > (unsigned)65535) { \