summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorMike Gorse <mgorse@suse.com>2023-01-25 02:02:48 +0000
committerPeter Hutterer <peter.hutterer@who-t.net>2023-02-07 10:21:52 +1000
commit4b925d388f76764dcb02dfd1cd7276262dcd7d74 (patch)
tree4e50600d712757b0b2cc41d9b68a3dd5aa96fb53 /dix
parent44d6c82ac82a78d904a6d47387ac363d9699b891 (diff)
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 2ef5ef57bd37a8bec2ac454053b283c6f87c3b40)
Diffstat (limited to 'dix')
-rw-r--r--dix/events.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dix/events.c b/dix/events.c
index 782ed35dc..86f5357e8 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -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);
}