mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-25 02:30:06 +01:00
Xi: get the class length before swapping.
Advancing by the already-swapped length lets our pointers point into nirvana. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
9974249980
commit
482cc72aa7
1 changed files with 2 additions and 1 deletions
|
|
@ -425,6 +425,7 @@ SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info)
|
|||
|
||||
for (i = 0; i < info->num_classes; i++)
|
||||
{
|
||||
int len = ((xXIAnyInfo*)any)->length;
|
||||
switch(((xXIAnyInfo*)any)->type)
|
||||
{
|
||||
case ButtonClass:
|
||||
|
|
@ -438,7 +439,7 @@ SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info)
|
|||
break;
|
||||
}
|
||||
|
||||
any += (((xXIAnyInfo*)any)->length * 4);
|
||||
any += len * 4;
|
||||
}
|
||||
|
||||
swaps(&info->deviceid, n);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue