summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Buhr <andreas.buhr@qt.io>2021-11-11 11:37:22 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-11-11 22:13:59 +0000
commit682b19a8c7cd2bba669064f9e99d1acfe835326f (patch)
tree5aed64be54e3ed8866546e20e826848cfa2553bf /src
parent741f15fa6d0b8bf45eef141493cc030ea6056ec2 (diff)
Fix QMultiHash::operator== crash
QMultiHash::operator== crashes when comparing two unequal objects. This patch fixes it. Fixes: QTBUG-98265 Change-Id: Ibf9fef3372a2b4581843be5f25e65cc9a55ef64d Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 838edd9c48284b97dfc22cf3644bb082035a9a93) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qhash.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h
index f7f37de091..14e9cc452c 100644
--- a/src/corelib/tools/qhash.h
+++ b/src/corelib/tools/qhash.h
@@ -1312,12 +1312,12 @@ public:
if (d->size != other.d->size)
return false;
for (auto it = other.d->begin(); it != other.d->end(); ++it) {
- auto i = d->find(it.node()->key);
- if (i == d->end())
+ auto *n = d->findNode(it.node()->key);
+ if (!n)
return false;
Chain *e = it.node()->value;
while (e) {
- Chain *oe = i.node()->value;
+ Chain *oe = n->value;
while (oe) {
if (oe->value == e->value)
break;