From e693c9657f98c334e9921ca2f8ebf710497c0c6a Mon Sep 17 00:00:00 2001 From: Arthur Williams Date: Sun, 6 Oct 2019 11:55:35 -0700 Subject: 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 --- dix/devices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dix') diff --git a/dix/devices.c b/dix/devices.c index 1b18b168e..00c453980 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -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; } /** -- cgit v1.2.3