summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2022-11-07 14:05:04 +0100
committerMårten Nordheim <marten.nordheim@qt.io>2022-11-09 15:14:54 +0100
commit7898de4258e06671feb84cfd0b746009b64f7f0d (patch)
tree25c5140467e2d4adbb7b51807eef72a0fd319fb7 /src/corelib/thread
parent7cc0a8741c88d6a9de414fdce169db981e41736e (diff)
QNetworkInformation[Win]: Fix potential use-after/during-free
The WinRT NetworkStatusChanged callback may happen during or slightly before we unregister our token, which we usually follow up by destroying the object. So we have to avoid potentially doing work on a deallocated object. Do this using the old QPointer-trick. Neither me nor reporter can reproduce it locally, so this is only a best-measure. Further problems may be that the storage for the lambda has already been destroyed and repurposed, in which case the pointer may be valid, but junk, which would lead to another crash. But this is unavoidable as long as MS does not synchronize callbacks with (un)registering new callbacks. To attempt combatting this we hold our own lock around unregistration and the "meat" of the callback. Pick-to: 6.4 6.4.1 Fixes: QTBUG-108218 Change-Id: Iacf8b8f458cca3152ff395e9a38e8df193534f46 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/corelib/thread')
0 files changed, 0 insertions, 0 deletions