diff options
author | John Brooks <john.brooks@crimson.no> | 2020-04-30 08:47:40 -0700 |
---|---|---|
committer | Robert Griebl <robert.griebl@qt.io> | 2020-05-19 11:56:48 +0200 |
commit | 9012bd5cb1375264b3f61a6c5435161f1dd455e2 (patch) | |
tree | e77316667a96336f9fe3ce053b1c85cf65b4fc05 /src/window-lib/waylandcompositor.h | |
parent | 29719f7a3ac17c76571825e3b57e7278f9a290b7 (diff) | |
download | qtapplicationmanager-9012bd5cb1375264b3f61a6c5435161f1dd455e2.tar.gz |
Fix use-after-free on xdg pong
With the xdg shell, ping is not related to a particular surface.
WaylandCompositor associates the pong with its original WindowSurface
with a map of the serial number to WindowSurface.
If the WindowSurface is destroyed before pong arrives, the map will have
an invalid pointer leading to a compositor crash.
Change-Id: Ide32ac80d42bf8373e8180e12ab89b29e6d00341
Reviewed-by: Robert Griebl <robert.griebl@qt.io>
(cherry picked from commit 7038e1681863c8a59c6c6a758fc7ec41f29f2be7)
Reviewed-by: Bernd Weimer <bernd.weimer@pelagicore.com>
Diffstat (limited to 'src/window-lib/waylandcompositor.h')
-rw-r--r-- | src/window-lib/waylandcompositor.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/window-lib/waylandcompositor.h b/src/window-lib/waylandcompositor.h index 5d554d16..ddf0ab97 100644 --- a/src/window-lib/waylandcompositor.h +++ b/src/window-lib/waylandcompositor.h @@ -53,6 +53,7 @@ #include <QWaylandQuickItem> #include <QMap> +#include <QPointer> QT_FORWARD_DECLARE_CLASS(QWaylandResource) QT_FORWARD_DECLARE_CLASS(QWaylandWlShell) @@ -147,7 +148,7 @@ protected: QVector<QWaylandOutput *> m_outputs; WaylandQtAMServerExtension *m_amExtension; QWaylandTextInputManager *m_textInputManager; - QMap<uint, WindowSurface*> m_xdgPingMap; + QMap<uint, QPointer<WindowSurface>> m_xdgPingMap; }; QT_END_NAMESPACE_AM |