Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.15.0
-
None
-
e790af0e0a030dea597bbc9489170b5ba1cf9e46 (qt/qtbase/dev) 801f719f12da68508a21ecebf1b37db6650beb8a (qt/qtbase/5.15)
Description
QJsonDocument::operator== does not check if 'other' is valid before accessing
'other.d->value'.
bool QJsonDocument::operator==(const QJsonDocument &other) const { return (!d) ? (!other.d) : (d->value == other.d->value); }
Something like the following leads to a segfault.
QJsonDocument validDoc = ... // a valid json document QJsonDocument invalidDoc{}; // an invalid json document if (validDoc == invalidDoc) { // segfault here ... }