From 4d60ba61dca7d50c8eaf9f4525cb9565b363ca81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Fri, 17 Jun 2022 16:11:59 +0200 Subject: Fix QDBusInterface crashing with empty path on construction On some machines having an empty path passed to QDBusInterface would cause a crash. This happened because the code created a QDBusMessage and manually marked it as validated when it was not. The validation would not pass for this object. Change-Id: I496dd922fa64353399655a1e84996b99990f5879 Pick-to: 6.4 6.3 6.2 5.15 Reviewed-by: Thiago Macieira --- src/dbus/qdbusintegrator.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/dbus') diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index 348171ef88..e9b4bd0b1d 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -2556,6 +2556,11 @@ QDBusConnectionPrivate::findMetaObject(const QString &service, const QString &pa if (mo) return mo; } + if (path.isEmpty()) { + error = QDBusError(QDBusError::InvalidObjectPath, "Object path cannot be empty"_L1); + lastError = error; + return nullptr; + } // introspect the target object QDBusMessage msg = QDBusMessage::createMethodCall(service, path, -- cgit v1.2.3