add null pointer checks for listener, dev and ti

This commit is contained in:
Frederik Hertzum 2025-07-05 12:33:56 +02:00
parent 23e83724df
commit 99583ddd81
2 changed files with 20 additions and 2 deletions

View File

@ -1294,13 +1294,13 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
*mask = NULL;
*grab = NULL;
if (listener->type == LISTENER_GRAB ||
if (listener && listener->type == LISTENER_GRAB ||
listener->type == LISTENER_POINTER_GRAB) {
*grab = listener->grab;
BUG_RETURN_VAL(!*grab, FALSE);
}
else if (ti->emulate_pointer && dev->deviceGrab.grab &&
else if (ti && ti->emulate_pointer && dev && dev->deviceGrab.grab &&
!dev->deviceGrab.fromPassiveGrab) {
/* There may be an active pointer grab on the device */
*grab = dev->deviceGrab.grab;

18
Xi/exevents.c.rej Normal file
View File

@ -0,0 +1,18 @@
--- exevents.c
+++ exevents.c
@@ -1294,13 +1294,13 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
*mask = NULL;
*grab = NULL;
- if (listener->type == LISTENER_GRAB ||
+ if (listener && listener->type == LISTENER_GRAB ||
listener->type == LISTENER_POINTER_GRAB) {
*grab = listener->grab;
BUG_RETURN_VAL(!*grab, FALSE);
}
- else if (ti->emulate_pointer && dev->deviceGrab.grab &&
+ else if (ti && ti->emulate_pointer && dev && dev->deviceGrab.grab &&
!dev->deviceGrab.fromPassiveGrab) {
/* There may be an active pointer grab on the device */
*grab = dev->deviceGrab.grab;