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>
This commit is contained in:
Arthur Williams 2019-10-06 11:55:35 -07:00
parent a505ecba10
commit e693c9657f
1 changed files with 1 additions and 1 deletions

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;
}
/**