mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-05 08:48:01 +02:00
Xi: require a pointer and keyboard device for XIAttachToMaster
If we remove a master device and specify which other master devices
attached slaves should be returned to, enforce that those two are
indeeed a pointer and a keyboard.
Otherwise we can try to attach the keyboards to pointers and vice versa,
leading to possible crashes later.
(cherry picked from commit 37539cb0bf)
This commit is contained in:
parent
630da5cb17
commit
8134574102
1 changed files with 2 additions and 2 deletions
|
|
@ -270,7 +270,7 @@ remove_master(ClientPtr client, xXIRemoveMasterInfo * r, int flags[MAXDEVICES])
|
|||
if (rc != Success)
|
||||
goto unwind;
|
||||
|
||||
if (!IsMaster(newptr)) {
|
||||
if (!IsMaster(newptr) || !IsPointerDevice(newptr)) {
|
||||
client->errorValue = r->return_pointer;
|
||||
rc = BadDevice;
|
||||
goto unwind;
|
||||
|
|
@ -281,7 +281,7 @@ remove_master(ClientPtr client, xXIRemoveMasterInfo * r, int flags[MAXDEVICES])
|
|||
if (rc != Success)
|
||||
goto unwind;
|
||||
|
||||
if (!IsMaster(newkeybd)) {
|
||||
if (!IsMaster(newkeybd) || !IsKeyboardDevice(newkeybd)) {
|
||||
client->errorValue = r->return_keyboard;
|
||||
rc = BadDevice;
|
||||
goto unwind;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue