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 <thiago.macieira@intel.com>
This commit is contained in:
Ievgenii Meshcheriakov 2023-09-08 14:16:14 +02:00
parent 9ff099e966
commit 7e3d29f618

View File

@ -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 ':'