xserver/Xi
Peter Hutterer fd7da4bddd Xi: when removing a master search for a disabled paired device
If either the master pointer or keyboard was disabled, the respective
GetMaster() call returns NULL, causing a segfault later accessing the
deviceid.

Fix this by looking in the off_devices list for any master
device of the type we're looking for. Master devices lose the pairing
when disabled (on enabling a keyboard we simply pair with the first
available unpaired pointer).

And for readability, split the device we get from the protocol request
into a new "dev" variable instead of re-using ptr.

Fixes #1611

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1256>
2024-10-31 15:39:06 +01:00
..
XIstubs.h (submit/unexport-xistub) include: unexport XIstubs.h 2024-08-29 20:51:22 +02:00
allowev.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
allowev.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
chgdctl.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
chgdctl.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
chgfctl.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
chgfctl.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
chgkbd.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
chgkbd.h (submit/fixup-req-len) Xi: drop now obsolete swap procs 2024-08-29 20:51:20 +02:00
chgkmap.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
chgkmap.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
chgprop.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
chgprop.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
chgptr.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
chgptr.h (submit/fixup-req-len) Xi: drop now obsolete swap procs 2024-08-29 20:51:20 +02:00
closedev.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
closedev.h (submit/fixup-req-len) Xi: drop now obsolete swap procs 2024-08-29 20:51:20 +02:00
devbell.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
devbell.h (submit/fixup-req-len) Xi: drop now obsolete swap procs 2024-08-29 20:51:20 +02:00
exevents.c (submit/dixgrabs.h) dix: unexport AddPassiveGrabToList() 2024-08-29 20:51:21 +02:00
exglobals.h xinput: Remove PropagateMask 2020-03-30 21:48:11 +00:00
extinit.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
getbmap.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
getbmap.h (submit/fixup-req-len) Xi: drop now obsolete swap procs 2024-08-29 20:51:20 +02:00
getdctl.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
getdctl.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
getfctl.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
getfctl.h (submit/fixup-req-len) Xi: drop now obsolete swap procs 2024-08-29 20:51:20 +02:00
getfocus.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
getfocus.h (submit/fixup-req-len) Xi: drop now obsolete swap procs 2024-08-29 20:51:20 +02:00
getkmap.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
getkmap.h (submit/fixup-req-len) Xi: drop now obsolete swap procs 2024-08-29 20:51:20 +02:00
getmmap.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
getmmap.h (submit/fixup-req-len) Xi: drop now obsolete swap procs 2024-08-29 20:51:20 +02:00
getprop.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
getprop.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
getselev.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
getselev.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
getvers.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
getvers.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
grabdev.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
grabdev.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
grabdevb.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
grabdevb.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
grabdevk.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
grabdevk.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
gtmotion.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
gtmotion.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
listdev.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
listdev.h (submit/fixup-req-len) Xi: drop now obsolete swap procs 2024-08-29 20:51:20 +02:00
meson.build Add a Meson build system alongside autotools. 2017-04-26 15:25:27 -07:00
opendev.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
opendev.h (submit/fixup-req-len) Xi: drop now obsolete swap procs 2024-08-29 20:51:20 +02:00
queryst.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
queryst.h (submit/fixup-req-len) Xi: drop now obsolete swap procs 2024-08-29 20:51:20 +02:00
selectev.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
selectev.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
sendexev.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
sendexev.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
setbmap.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
setbmap.h (submit/fixup-req-len) Xi: drop now obsolete swap procs 2024-08-29 20:51:20 +02:00
setdval.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
setdval.h (submit/fixup-req-len) Xi: drop now obsolete swap procs 2024-08-29 20:51:20 +02:00
setfocus.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
setfocus.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
setmmap.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
setmmap.h (submit/fixup-req-len) Xi: drop now obsolete swap procs 2024-08-29 20:51:20 +02:00
setmode.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
setmode.h (submit/fixup-req-len) Xi: drop now obsolete swap procs 2024-08-29 20:51:20 +02:00
stubs.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
ungrdev.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
ungrdev.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
ungrdevb.c (submit/dixgrabs.h) dix: unexport DeletePassiveGrabFromList() 2024-08-29 20:51:21 +02:00
ungrdevb.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
ungrdevk.c (submit/dixgrabs.h) dix: unexport DeletePassiveGrabFromList() 2024-08-29 20:51:21 +02:00
ungrdevk.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xiallowev.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
xiallowev.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xibarriers.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
xibarriers.h Xi: free barrier code at reset time 2013-05-07 09:41:19 +10:00
xichangecursor.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
xichangecursor.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xichangehierarchy.c Xi: when removing a master search for a disabled paired device 2024-10-31 15:39:06 +01:00
xichangehierarchy.h (submit/fixup-req-len) Xi: drop now obsolete swap procs 2024-08-29 20:51:20 +02:00
xigetclientpointer.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
xigetclientpointer.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xigrabdev.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
xigrabdev.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xipassivegrab.c (submit/dixgrabs.h) dix: unexport DeletePassiveGrabFromList() 2024-08-29 20:51:21 +02:00
xipassivegrab.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xiproperty.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
xiproperty.h (submit/fixup-req-len) Xi: drop now obsolete swap procs 2024-08-29 20:51:20 +02:00
xiquerydevice.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
xiquerydevice.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xiquerypointer.c (submit/rename-panoramix-sym) rename old symbol PANORAMIX to XINERAMA 2024-08-29 20:51:22 +02:00
xiquerypointer.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xiqueryversion.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
xiqueryversion.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xiselectev.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
xiselectev.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xisetclientpointer.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
xisetclientpointer.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xisetdevfocus.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
xisetdevfocus.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
xiwarppointer.c (submit/drop-obsolete-have-dix-config.h) drop obsolete HAVE_DIX_CONFIG_H 2024-08-29 20:51:21 +02:00
xiwarppointer.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00