summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDemi Marie Obenour <demi@invisiblethingslab.com>2021-07-20 22:58:42 -0400
committerDemi Marie Obenour <demi@invisiblethingslab.com>2021-08-06 11:12:40 -0400
commit31fb35a7afc782e857bf60e524e7d966dbcd2551 (patch)
tree38374c9f9dc668f1030b6d710d517a42ec5a2609
parent7eba412072afdc9d27896410872e40364a8010bf (diff)
XFixes: add version check for byteswapped clients
The version check for byteswapped clients was missing.
-rw-r--r--xfixes/xfixes.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/xfixes/xfixes.c b/xfixes/xfixes.c
index 3ba7314a7..ecb6f298f 100644
--- a/xfixes/xfixes.c
+++ b/xfixes/xfixes.c
@@ -215,7 +215,11 @@ static _X_COLD int
SProcXFixesDispatch(ClientPtr client)
{
REQUEST(xXFixesReq);
- if (stuff->xfixesReqType >= XFixesNumberRequests)
+ XFixesClientPtr pXFixesClient = GetXFixesClient(client);
+
+ if (pXFixesClient->major_version >= ARRAY_SIZE(version_requests))
+ return BadRequest;
+ if (stuff->xfixesReqType > version_requests[pXFixesClient->major_version])
return BadRequest;
return (*SProcXFixesVector[stuff->xfixesReqType]) (client);
}