mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-02-06 04:40:28 +01:00
Xi: Do not try to swap GenericEvent.
The SProcXSendExtensionEvent must not attempt to swap GenericEvent because
it is assuming that the event has fixed size and gives the swapping function
xEvent-sized buffer.
A GenericEvent would be later rejected by ProcXSendExtensionEvent anyway.
Signed-off-by: Michal Srb <msrb@suse.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit ba336b2405)
This commit is contained in:
parent
e8f6a1bb77
commit
ed8fbabaca
1 changed files with 10 additions and 2 deletions
|
|
@ -95,9 +95,17 @@ SProcXSendExtensionEvent(ClientPtr client)
|
|||
|
||||
eventP = (xEvent *) &stuff[1];
|
||||
for (i = 0; i < stuff->num_events; i++, eventP++) {
|
||||
proc = EventSwapVector[eventP->u.u.type & 0177];
|
||||
if (proc == NotImplemented) /* no swapping proc; invalid event type? */
|
||||
if (eventP->u.u.type == GenericEvent) {
|
||||
client->errorValue = eventP->u.u.type;
|
||||
return BadValue;
|
||||
}
|
||||
|
||||
proc = EventSwapVector[eventP->u.u.type & 0177];
|
||||
/* no swapping proc; invalid event type? */
|
||||
if (proc == NotImplemented) {
|
||||
client->errorValue = eventP->u.u.type;
|
||||
return BadValue;
|
||||
}
|
||||
(*proc) (eventP, &eventT);
|
||||
*eventP = eventT;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue