diff options
author | Paul Olav Tvete <paul.tvete@qt.io> | 2020-12-23 13:18:04 +0100 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@qt.io> | 2020-12-23 15:25:02 +0100 |
commit | c80d6473fbeb43074fb63db66e162e76cb2bf3ef (patch) | |
tree | 23703fe65d69a19fc05c3c6209cafad654929f2c /src/plugins/platforms/xcb/qxcbconnection.h | |
parent | 3729d37dd9ad38044242097adaa4bd74e2d5de87 (diff) |
Fix out-of-bounds write
Change ac210c73e4 introduced the requirement that all input devices with
Scroll capability must have a QXcbScrollingDevicePrivate as their d_ptr.
However, this was not enforced, and would fail for the "Virtual core
pointer".
To fix this, always use qobject_cast to verify that the device is of the
correct type.
Change-Id: I4a6b1d4d79308eb04e9f52dda00294fffe377bdf
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.h')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index b62d461170..1e402a37de 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -78,7 +78,7 @@ class QXcbScreen; class QXcbWindow; class QXcbDrag; class QXcbKeyboard; -class QXcbScrollingDevicePrivate; +class QXcbScrollingDevice; class QXcbClipboard; class QXcbWMSupport; class QXcbNativeInterface; @@ -316,8 +316,8 @@ private: TabletData *tabletDataForDevice(int id); #endif // QT_CONFIG(tabletevent) void xi2HandleScrollEvent(void *event, const QPointingDevice *scrollingDevice); - void xi2UpdateScrollingDevice(QXcbScrollingDevicePrivate *scrollingDevice); - QXcbScrollingDevicePrivate *scrollingDeviceForId(int id); + void xi2UpdateScrollingDevice(QInputDevice *scrollingDevice); + QXcbScrollingDevice *scrollingDeviceForId(int id); static bool xi2GetValuatorValueIfSet(const void *event, int valuatorNum, double *value); |