dix: Correctly save replayed event into GrabInfoRec

When processing events we operate on InternalEvent pointers. They may
actually refer to a an instance of DeviceEvent, GestureEvent or any
other event that comprises the InternalEvent union. This works well in
practice because we always look into event type before doing anything,
except in the case of copying the event.

*dst_event = *src_event would copy whole InternalEvent event and would
cause out of bounds read in case the pointed to event was not
InternalEvent but e.g. DeviceEvent.

This regression has been introduced in
23a8b62d34344575f9df9d057fb74bfefa94a77b.

Fixes https://gitlab.freedesktop.org/xorg/xserver/-/issues/1261

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
3 files changed
tree: c9f4456d70f4b88e8ca681c7fc28eb8ceb74081e
  1. .gitlab-ci/
  2. composite/
  3. config/
  4. damageext/
  5. dbe/
  6. dix/
  7. doc/
  8. dri3/
  9. exa/
  10. fb/
  11. glamor/
  12. glx/
  13. hw/
  14. include/
  15. m4/
  16. man/
  17. mi/
  18. miext/
  19. os/
  20. present/
  21. pseudoramiX/
  22. randr/
  23. record/
  24. render/
  25. test/
  26. Xext/
  27. xfixes/
  28. Xi/
  29. xkb/
  30. .appveyor.yml
  31. .dir-locals.el
  32. .gitignore
  33. .gitlab-ci.yml
  34. .travis.yml
  35. COPYING
  36. meson.build
  37. meson_options.txt
  38. README.md
  39. xorg-server.m4
  40. xorg-server.pc.in
  41. xserver.ent.in
README.md

X Server

The X server accepts requests from client applications to create windows, which are (normally rectangular) “virtual screens” that the client program can draw into.

Windows are then composed on the actual screen by the X server (or by a separate composite manager) as directed by the window manager, which usually communicates with the user via graphical controls such as buttons and draggable titlebars and borders.

For a comprehensive overview of X Server and X Window System, consult the following article: https://en.wikipedia.org/wiki/X_server

All questions regarding this software should be directed at the Xorg mailing list:

https://lists.freedesktop.org/mailman/listinfo/xorg

The primary development code repository can be found at:

https://gitlab.freedesktop.org/xorg/xserver

For patch submission instructions, see:

https://www.x.org/wiki/Development/Documentation/SubmittingPatches

As with other projects hosted on freedesktop.org, X.Org follows its Code of Conduct, based on the Contributor Covenant. Please conduct yourself in a respectful and civilized manner when using the above mailing lists, bug trackers, etc:

https://www.freedesktop.org/wiki/CodeOfConduct