From 7e3d29f618f4fb1464327abca49a33cb00a3ac91 Mon Sep 17 00:00:00 2001 From: Ievgenii Meshcheriakov Date: Fri, 8 Sep 2023 14:16:14 +0200 Subject: [PATCH] QDBusConnectionPrivate: Use write lock inside handleSignal() Slots like (un)registerServiceNoLock() modify shared state and should be run with write lock taken. Having only read lock results in hard to reproduce crashes. Task-number: QTBUG-116621 Change-Id: I4456b64f9f2200378012822143e1a05345859d62 Reviewed-by: Thiago Macieira --- src/dbus/qdbusintegrator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index da5affe7ed..c61ca27b5d 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -1656,7 +1656,7 @@ void QDBusConnectionPrivate::handleSignal(const QDBusMessage& msg) key += u':'; key += msg.interface(); - QDBusReadLocker locker(HandleSignalAction, this); + QDBusWriteLocker locker(HandleSignalAction, this); handleSignal(key, msg); // one try key.truncate(msg.member().size() + 1); // keep the ':'