mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
Fix for CVE-2007-6427 - Xinput extension memory corruption.
This commit is contained in:
12
Xi/grabdev.c
12
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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user