Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
4.6.0
-
None
-
fbb600a7a92b60b388406fecf2d8a94f0d4f5586
Description
QVarLengthArray::resize() does not initalize the new elements when it is called, the following will output false for the first debug and then crash when it tries to assign 2 to the variant:
#include <QtCore> int main(int argc, char **argv) { QCoreApplication ca(argc, argv); QVarLengthArray<QVariant,1> values(1); values[0] = 1; values.resize(2); qDebug() << (values[1] == QVariant()); values[1] = 2; qDebug() << (values[1] == 2); return 0; }