xtest: Check whether there is a sendEventsProc to call

If a client tries to send XTEST events while there is no sendEventsProc
defined for the given device, Xwayland would call into 0x0 and crash.

Make sure the handler is defined before trying to use it, to avoid the
crash.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1574
This commit is contained in:
Olivier Fourdan 2023-09-04 09:26:55 +02:00
parent 94945a5274
commit e820030de2

View File

@ -437,6 +437,7 @@ ProcXTestFakeInput(ClientPtr client)
valuator_mask_set_range(&mask, firstValuator, numValuators, valuators); valuator_mask_set_range(&mask, firstValuator, numValuators, valuators);
if (dev->sendEventsProc)
(*dev->sendEventsProc) (dev, type, ev->u.u.detail, flags, &mask); (*dev->sendEventsProc) (dev, type, ev->u.u.detail, flags, &mask);
if (need_ptr_update) if (need_ptr_update)