diff options
author | MÃ¥rten Nordheim <marten.nordheim@qt.io> | 2022-06-17 16:11:59 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-06-27 17:49:31 +0000 |
commit | a7044900b2fa2da2bdbc9de721b62c2703d64c2a (patch) | |
tree | 6dc2754bb1154238f6a29bc52dda9400b4c04ecf /src/dbus | |
parent | 40f8d923c75694ef1832fc50c96af712722cea95 (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
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4d60ba61dca7d50c8eaf9f4525cb9565b363ca81)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
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, |