mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-14 14:28:18 +02:00
Fix IsXtstDevice - returns false positives since 0814f511d5.
Missing check for the value of 'mid' returned false positives if master was NULL. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
3525d14056
commit
50a2a8dc76
1 changed files with 9 additions and 2 deletions
|
|
@ -2625,16 +2625,23 @@ int AllocXtstDevice (ClientPtr client, char* name,
|
||||||
BOOL
|
BOOL
|
||||||
IsXtstDevice(DeviceIntPtr dev, DeviceIntPtr master)
|
IsXtstDevice(DeviceIntPtr dev, DeviceIntPtr master)
|
||||||
{
|
{
|
||||||
|
int is_xtst = FALSE;
|
||||||
int mid;
|
int mid;
|
||||||
void *tmp; /* shut up, gcc! */
|
void *tmp; /* shut up, gcc! */
|
||||||
|
|
||||||
if (IsMaster(dev))
|
if (IsMaster(dev))
|
||||||
return FALSE;
|
return is_xtst;
|
||||||
|
|
||||||
tmp = dixLookupPrivate(&dev->devPrivates, XTstDevicePrivateKey);
|
tmp = dixLookupPrivate(&dev->devPrivates, XTstDevicePrivateKey);
|
||||||
mid = (int)tmp;
|
mid = (int)tmp;
|
||||||
|
|
||||||
return (!master || mid == master->id);
|
/* deviceid 0 is reserved for XIAllDevices, non-zero mid means xtst
|
||||||
|
* device */
|
||||||
|
if ((!master && mid) ||
|
||||||
|
(master && mid == master->id))
|
||||||
|
is_xtst = TRUE;
|
||||||
|
|
||||||
|
return is_xtst;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue