diff options
author | Liang Qi <liang.qi@qt.io> | 2020-08-05 14:11:39 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2020-08-06 06:51:24 +0200 |
commit | e80767d1fc45cfca96694937289712f0278f4945 (patch) | |
tree | 39dd9cceed0345da58dcd578d03c73ba15842c51 | |
parent | 7b76379a89158f10780cbfc74965027246faec68 (diff) |
xcb: avoid a usage of invalid reply in qxcbdrag
Fixes: QTBUG-83446
Pick-to: 5.15
Change-Id: I1f148c611dcab6cad951ddd934072933fef75452
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-rw-r--r-- | src/plugins/platforms/xcb/qxcbdrag.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/platforms/xcb/qxcbdrag.cpp b/src/plugins/platforms/xcb/qxcbdrag.cpp index 3e24027e51..837ad2ca5a 100644 --- a/src/plugins/platforms/xcb/qxcbdrag.cpp +++ b/src/plugins/platforms/xcb/qxcbdrag.cpp @@ -419,11 +419,12 @@ void QXcbDrag::move(const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardMod auto reply = Q_XCB_REPLY(xcb_get_property, xcb_connection(), false, proxy_target, atom(QXcbAtom::XdndAware), XCB_GET_PROPERTY_TYPE_ANY, 0, 1); - if (!reply || reply->type == XCB_NONE) + if (!reply || reply->type == XCB_NONE) { target = 0; - - target_version = *(uint32_t *)xcb_get_property_value(reply.get()); - target_version = qMin(xdnd_version, target_version ? target_version : 1); + } else { + target_version = *(uint32_t *)xcb_get_property_value(reply.get()); + target_version = qMin(xdnd_version, target_version ? target_version : 1); + } } if (target != current_target) { |