aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/include/dix.h
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/include/dix.h')
-rw-r--r--xorg-server/include/dix.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/xorg-server/include/dix.h b/xorg-server/include/dix.h
index 82bb58cbc..821b0ed68 100644
--- a/xorg-server/include/dix.h
+++ b/xorg-server/include/dix.h
@@ -74,9 +74,14 @@ SOFTWARE.
if ((sizeof(req) >> 2) > client->req_len )\
return(BadLength)
+#define REQUEST_AT_LEAST_EXTRA_SIZE(req, extra) \
+ if (((sizeof(req) + ((uint64_t) extra)) >> 2) > client->req_len ) \
+ return(BadLength)
+
#define REQUEST_FIXED_SIZE(req, n)\
if (((sizeof(req) >> 2) > client->req_len) || \
- (((sizeof(req) + (n) + 3) >> 2) != client->req_len)) \
+ (((n) >> 2) >= client->req_len) || \
+ ((((uint64_t) sizeof(req) + (n) + 3) >> 2) != (uint64_t) client->req_len)) \
return(BadLength)
#define LEGAL_NEW_RESOURCE(id,client)\