summaryrefslogtreecommitdiff
path: root/Xi/grabdev.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2008-01-26 13:55:07 +1030
committerPeter Hutterer <peter@cs.unisa.edu.au>2008-01-26 13:55:07 +1030
commit0ac175597712edfeae676f536746a4d26d625e30 (patch)
treebd34a9601dc6f1a446646e0907e49c90c6862cc0 /Xi/grabdev.c
parent210eeef495770c1883c842ff003c28ce25f279d4 (diff)
parente915a2639752bc0ea9e6e192e020cc2031c08063 (diff)
Merge branch 'master' into mpx
Conflicts: Xext/sampleEVI.c
Diffstat (limited to 'Xi/grabdev.c')
-rw-r--r--Xi/grabdev.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/Xi/grabdev.c b/Xi/grabdev.c
index fe58d565f..8217a9928 100644
--- a/Xi/grabdev.c
+++ b/Xi/grabdev.c
@@ -78,8 +78,6 @@ int
SProcXGrabDevice(ClientPtr client)
{
char n;
- long *p;
- int i;
REQUEST(xGrabDeviceReq);
swaps(&stuff->length, n);
@@ -87,11 +85,11 @@ SProcXGrabDevice(ClientPtr client)
swapl(&stuff->grabWindow, n);
swapl(&stuff->time, n);
swaps(&stuff->event_count, n);
- p = (long *)&stuff[1];
- for (i = 0; i < stuff->event_count; i++) {
- swapl(p, n);
- p++;
- }
+
+ if (stuff->length != (sizeof(xGrabDeviceReq) >> 2) + stuff->event_count)
+ return BadLength;
+
+ SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
return (ProcXGrabDevice(client));
}