dix: Check for NULL spriteInfo in GetPairedDevice

There is a race when reseting the XServer that causes spriteInfo to be
NULL in GetPairedDevice resulting a segfault and subsequent crash. The
problem was noticed when opening a connection, creating master devices,
destroying master devices and closing the connection during testing.

Signed-off-by: Arthur Williams <taaparthur@gmail.com>


(cherry picked from commit e693c9657f)
This commit is contained in:
Arthur Williams 2019-10-06 18:55:35 +00:00
parent 1610ef1d6b
commit 3c48bd50ad

View File

@ -2656,7 +2656,7 @@ GetPairedDevice(DeviceIntPtr dev)
if (!IsMaster(dev) && !IsFloating(dev))
dev = GetMaster(dev, MASTER_ATTACHED);
return dev->spriteInfo->paired;
return dev->spriteInfo? dev->spriteInfo->paired: NULL;
}
/**