dix: Use CopyPartialInternalEvent in EnqueueEvent

The event might be a DeviceEvent allocated on the stack, in
AccessXKeyboardEvent for instance. Fixes out-of-bounds read.

Signed-off-by: Mike Gorse <mgorse@suse.com>
(cherry picked from commit 2ef5ef57bd)
This commit is contained in:
Mike Gorse 2023-01-25 02:02:48 +00:00 committed by Peter Hutterer
parent 44d6c82ac8
commit 4b925d388f

View File

@ -1215,7 +1215,7 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device)
qe->pScreen = pSprite->hotPhys.pScreen;
qe->months = currentTime.months;
qe->event = (InternalEvent *) (qe + 1);
memcpy(qe->event, event, eventlen);
CopyPartialInternalEvent(qe->event, (InternalEvent *)event);
xorg_list_append(&qe->next, &syncEvents.pending);
}