summaryrefslogtreecommitdiffstats
path: root/src/gui/util/qedidvendortable_p.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-02-11 09:12:49 +0100
committerMarc Mutz <marc.mutz@qt.io>2022-02-12 12:39:51 +0100
commit42e13b7c61693ca95e119106d4f6dbd2bcf2308d (patch)
tree98604b83d7b53515afe71cd017ee2632478c8e5f /src/gui/util/qedidvendortable_p.h
parent4fd4082c3ab682f14911e6308ec5ccb400de34f9 (diff)
QDesktopServices: fix UB (data race on handlers)
The handlerDestroyed() function is connected to the handler QObject's destroyed() signal and removes all entries from the registry for which the destroyed object was listed as the handler. While handlerDestroyed() is always executed in the context of the thread owning QOpenUrlHandlerRegistry-as-a-QObject, the documentation explicitly states that "the handler will always be called from within the same thread that calls QDesktopServices::openUrl()", implying that calling openUrl() from a non-GUI thread is supported. The presence of the mutex also indicates that this should work. But then the unprotected access to the handlers variable in handlerDestroyed() is a data race, because nothing prevents a handler object from being destroyed concurrent to an openUrl() call. Fix by locking the mutex. Fixes: QTBUG-100777 Pick-to: 6.3 6.2 5.15 Change-Id: I9ef857efa609b4d16ee21063ccccd316e119576b Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/gui/util/qedidvendortable_p.h')
0 files changed, 0 insertions, 0 deletions