Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
6.2.1
-
None
-
838edd9c48284b97dfc22cf3644bb082035a9a93 (qt/qtbase/dev) 682b19a8c7cd2bba669064f9e99d1acfe835326f (qt/qtbase/6.2)
Description
This code crashes:
#include <QBluetoothUuid> int main(int argc, char** argv) { typedef QMultiHash<QBluetoothUuid, QByteArray> Hash; Hash a; a.insert(QBluetoothUuid(quint16(32)), QByteArray()); Hash b; b.insert(QBluetoothUuid(quint16(33)), QByteArray()); if (a == b){ qDebug() << "equal"; } else { qDebug() << "unequal"; } return 0; }
The reason seems to be in its implementation. Here, it should "return false" in line 1324:
but the "if (i == e->ned())" can never trigger. The reason is that "end()" returns an iterator with the "d" pointer set to "nullptr". But all code pathes in "find()" return an iterator with the "d" pointer set to "this"