From c80d6473fbeb43074fb63db66e162e76cb2bf3ef Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 23 Dec 2020 13:18:04 +0100 Subject: 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 --- src/plugins/platforms/xcb/qxcbconnection.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins/platforms/xcb/qxcbconnection.h') 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); -- cgit v1.2.3