mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-07 20:18:03 +02:00
dix: copy event in TouchConvertToPointerEvent correctly
Fixes reading random memory read beyond the end of original event.
sizeof device_event: 424
sizeof internal_event: 2800
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 98b94c36d6)
This commit is contained in:
parent
05ca549d81
commit
a11cf8dd68
1 changed files with 2 additions and 2 deletions
|
|
@ -620,14 +620,14 @@ TouchConvertToPointerEvent(const InternalEvent *event,
|
|||
BUG_WARN_MSG(!(event->device_event.flags & TOUCH_POINTER_EMULATED),
|
||||
"Non-emulating touch event\n");
|
||||
|
||||
*motion_event = *event;
|
||||
motion_event->device_event = event->device_event;
|
||||
motion_event->any.type = ET_Motion;
|
||||
motion_event->device_event.detail.button = 0;
|
||||
motion_event->device_event.flags = XIPointerEmulated;
|
||||
|
||||
if (nevents > 1) {
|
||||
BUG_RETURN_VAL(!button_event, 0);
|
||||
*button_event = *event;
|
||||
button_event->device_event = event->device_event;
|
||||
button_event->any.type = ptrtype;
|
||||
button_event->device_event.flags = XIPointerEmulated;
|
||||
/* detail is already correct */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue