aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/Xi/grabdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs/Xserver/Xi/grabdev.c')
-rw-r--r--nx-X11/programs/Xserver/Xi/grabdev.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/nx-X11/programs/Xserver/Xi/grabdev.c b/nx-X11/programs/Xserver/Xi/grabdev.c
index 3b124a0f4..21e920a35 100644
--- a/nx-X11/programs/Xserver/Xi/grabdev.c
+++ b/nx-X11/programs/Xserver/Xi/grabdev.c
@@ -87,8 +87,6 @@ SProcXGrabDevice(client)
register ClientPtr client;
{
register char n;
- register long *p;
- register int i;
REQUEST(xGrabDeviceReq);
swaps(&stuff->length, n);
@@ -96,12 +94,11 @@ SProcXGrabDevice(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));
}