From 3f69ab1bf06c0daae66a709e2eb0b0a08481337f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 20 Jun 2016 16:25:15 +0200 Subject: [PATCH] [server] Add resource check in QtExtendedSurfaceInterface::close Summary: The QtExtendedSurfaceInterface might be unbound and thus the resource might be null when calling into close. Thus we need to do a nullptr check. Hit a crash there. Test Plan: Unfortunately no test case as we don't have a client side implementation for this. Reviewers: #plasma_on_wayland Subscribers: plasma-devel Tags: #plasma_on_wayland Differential Revision: https://phabricator.kde.org/D1961 --- src/wayland/server/qtsurfaceextension_interface.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wayland/server/qtsurfaceextension_interface.cpp b/src/wayland/server/qtsurfaceextension_interface.cpp index 7b388afa8d..fbe2fbe388 100644 --- a/src/wayland/server/qtsurfaceextension_interface.cpp +++ b/src/wayland/server/qtsurfaceextension_interface.cpp @@ -219,6 +219,9 @@ QtExtendedSurfaceInterface::Private *QtExtendedSurfaceInterface::d_func() const void QtExtendedSurfaceInterface::close() { Q_D(); + if (!d->resource) { + return; + } qt_extended_surface_send_close(d->resource); d->client->flush(); }