diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-05-20 06:28:26 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-06-01 20:59:16 +0000 |
commit | bbb440bab261fecc7c9baf779dadf36659d3cf6f (patch) | |
tree | d68c758d32e8ab6b331f447fae9173bb7a8d031b /src/network/socket/qnativesocketengine_winrt.cpp | |
parent | a1de7c40f4a22f996fcf922e69315c1f2cea6e96 (diff) |
QJsonValue: fix use-after-free in assignment operator
The assignment operator of a String QJsonValue that holds
the only remaining reference to the QString::Data block
was freeing the block before obtaining its own reference,
leading to a use-after-free in the case where *this was
passed as 'other' (self-assignment).
Fixed by reformulating the assignment operator in terms
of the copy ctor, using the copy-swap idiom, with the
twist that QJsonValue doesn't, yet, have a swap member
function, so we use three per-member qSwap()s.
Change-Id: I3c5ccc4d9f32c7593af3fc6a0edbf12b7feb1391
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/network/socket/qnativesocketengine_winrt.cpp')
0 files changed, 0 insertions, 0 deletions