From 58541d1c68fcf121318fe153e1469b9d0ebfec63 Mon Sep 17 00:00:00 2001 From: Jesus Fernandez Date: Tue, 23 Jan 2018 12:39:48 +0100 Subject: QGuiApplicationPrivate::processDrag(): Add assert CID 186303 (#1 of 3): Dereference after null check (FORWARD_NULL) var_deref_model: Passing null pointer w to sendEvent, which dereferences it. Coverity-Id: 186303 Change-Id: If398165858b91508ccdf4be0c239d6bb104d78fa Reviewed-by: Friedemann Kleint --- src/gui/kernel/qguiapplication.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 25818b456a..9da325f46e 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -2882,7 +2882,8 @@ QPlatformDragQtResponse QGuiApplicationPrivate::processDrag(QWindow *w, const QM static QPointer currentDragWindow; static Qt::DropAction lastAcceptedDropAction = Qt::IgnoreAction; QPlatformDrag *platformDrag = platformIntegration()->drag(); - if (!platformDrag || (w && w->d_func()->blockedByModalWindow)) { + Q_ASSERT(w); + if (!platformDrag || w->d_func()->blockedByModalWindow) { lastAcceptedDropAction = Qt::IgnoreAction; return QPlatformDragQtResponse(false, lastAcceptedDropAction, QRect()); } -- cgit v1.2.3