]> git.lyx.org Git - lyx.git/commit
Fix write to uninitialized bytes for XCB event
authorScott Kostyshak <skostysh@lyx.org>
Wed, 19 Feb 2020 02:39:18 +0000 (21:39 -0500)
committerScott Kostyshak <skostysh@lyx.org>
Wed, 19 Feb 2020 14:48:54 +0000 (09:48 -0500)
commit19c41bd09572f15ac3546c8e6a6d4ec15306c93a
tree735b7accd051c797217b2a7691b9bf8bdb92dd6b
parentb7af21ad7c0a9c26600584ed122772214d1da9ef
Fix write to uninitialized bytes for XCB event

As the xcb_send_event man page [1] states,

  In order to properly initialize these bytes, we allocate 32 bytes
  even though we only need less for an xcb_configure_notify_event_t

This commit fixes the following Valgrind error, which could be
triggered by selecting a letter in LyX:

  ==12698== Syscall param writev(vector[...]) points to uninitialised byte(s)
  ==12698==    at 0x61F578D: __writev (writev.c:26)
  ==12698==    by 0x61F578D: writev (writev.c:24)
  ==12698==    by 0x4A83BFC: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
  ==12698==    by 0x4A83FD0: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
  ==12698==    by 0x4A84246: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
  ==12698==    by 0x4A84ACB: xcb_flush (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
  ==12698==    by 0x17C8F06: lyx::frontend::GuiApplication::nativeEventFilter(QByteArray const&, void*, long*) (GuiApplication.cpp:3366)
  ==12698==    by 0x5AA4EEE: QAbstractEventDispatcher::filterNativeEvent(QByteArray const&, void*, long*) (qabstracteventdispatcher.cpp:484)

[1] https://www.x.org/releases/current/doc/man/man3/xcb_send_event.3.xhtml
src/frontends/qt/GuiApplication.cpp