aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/Xi/grabdev.c
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2011-10-10 17:46:43 +0200
committerReinhard Tartler <siretart@tauware.de>2011-10-10 17:46:43 +0200
commit3d1c57d5ef429e51ab7a626540c30b81e74a8f17 (patch)
tree2589846dd73cb0a86156fc5f2575ea2373431a57 /nx-X11/programs/Xserver/Xi/grabdev.c
parent844a4094f098684dd1da5bc11e73479fb61373a3 (diff)
downloadnx-libs-3d1c57d5ef429e51ab7a626540c30b81e74a8f17.tar.gz
nx-libs-3d1c57d5ef429e51ab7a626540c30b81e74a8f17.tar.bz2
nx-libs-3d1c57d5ef429e51ab7a626540c30b81e74a8f17.zip
Imported nx-X11-3.1.0-4.tar.gznx-X11/3.1.0-4
Summary: Imported nx-X11-3.1.0-4.tar.gz Keywords: Imported nx-X11-3.1.0-4.tar.gz into Git repository
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));
}