summaryrefslogtreecommitdiff
path: root/damageext
diff options
context:
space:
mode:
authorDemi Marie Obenour <demi@invisiblethingslab.com>2021-08-06 13:23:08 -0400
committerPovilas Kanapickas <povilas@radix.lt>2021-08-08 12:43:01 +0000
commit659260a0b7c1cef6060bd62a83deb03e3fa472b1 (patch)
treeb05f74c48be2ea64ce09a952031d3b3ed301bf1b /damageext
parente4dabe8d9395d60699aa9831626920adaa847680 (diff)
More missing version checks in SProcs
The bug in XFixes was also found in GenericEvent and Damage.
Diffstat (limited to 'damageext')
-rw-r--r--damageext/damageext.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/damageext/damageext.c b/damageext/damageext.c
index ce490cbf2..c8194da07 100644
--- a/damageext/damageext.c
+++ b/damageext/damageext.c
@@ -561,7 +561,11 @@ static int _X_COLD
SProcDamageDispatch(ClientPtr client)
{
REQUEST(xDamageReq);
- if (stuff->damageReqType >= XDamageNumberRequests)
+ DamageClientPtr pDamageClient = GetDamageClient(client);
+
+ if (pDamageClient->major_version >= ARRAY_SIZE(version_requests))
+ return BadRequest;
+ if (stuff->damageReqType > version_requests[pDamageClient->major_version])
return BadRequest;
return (*SProcDamageVector[stuff->damageReqType]) (client);
}