diff options
author | Mårten Nordheim <marten.nordheim@qt.io> | 2022-06-17 16:11:59 +0200 |
---|---|---|
committer | Mårten Nordheim <marten.nordheim@qt.io> | 2022-06-27 14:02:47 +0200 |
commit | 4d60ba61dca7d50c8eaf9f4525cb9565b363ca81 (patch) | |
tree | 7f579034cbd298013fdfe336109d3e63ff01c4d2 /src/dbus | |
parent | 2ba153dd5f450c008d49d30b5868abbca1974e28 (diff) |
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 <thiago.macieira@intel.com>
Diffstat (limited to 'src/dbus')
-rw-r--r-- | src/dbus/qdbusintegrator.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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, |