mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-07 17:12:09 +00:00
dix: don't allow slave devices as ClientPointer
This commit is contained in:
10
dix/events.c
10
dix/events.c
@@ -6103,6 +6103,16 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events)
|
||||
_X_EXPORT Bool
|
||||
SetClientPointer(ClientPtr client, ClientPtr setter, DeviceIntPtr device)
|
||||
{
|
||||
if (!device->isMaster)
|
||||
{
|
||||
ErrorF("[dix] Need master device for ClientPointer. This is a bug.\n");
|
||||
return FALSE;
|
||||
} else if (!device->spriteInfo->spriteOwner)
|
||||
{
|
||||
ErrorF("[dix] Device %d does not have a sprite. "
|
||||
"Cannot be ClientPointer\n", device->id);
|
||||
return FALSE;
|
||||
}
|
||||
client->clientPtr = device;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user