qt5base-lts/tests/auto
Thiago Macieira 9a55f40937 QCborStreamReader: avoid allocating result if data is insufficient
By calling the internal readStringChunk() function with a QByteArray
pointer, QCborStreamReader::readByteArray() can now avoid allocating the
resulting buffer until the internals have confirmed that there is
sufficient data in the incoming buffer. As a result, we first detect the
EOF condition before we conclude the payload would have been too big for
QByteArray (validation()) test. Meanwhile, the hugeDeviceValidation()
test ends up with a few conditions where it would have copied 1 GB of
data, so limit that too.

We make a choice of reporting OOM vs DataTooLarge only if QByteArray
fails to allocate in the first place (QByteArray::resize() ->
Q_CHECK_PTR -> qBadAlloc, QtCore is always built with exceptions on).

The QCborValue unit test needed a temporary work around until we apply
the same allocation fix (see next commit).

Pick-to: 5.15 6.0
Fixes: QTBUG-88253
Change-Id: I7b9b97ae9b32412abdc6fffd164523eeae49cdfe
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-12-06 07:50:57 +00:00
..
cmake CMake: Change generated resources naming 2020-11-24 21:51:29 +01:00
concurrent QtConcurrent: filter/map reduction without default ctor 2020-12-04 15:36:50 +01:00
corelib QCborStreamReader: avoid allocating result if data is insufficient 2020-12-06 07:50:57 +00:00
dbus QChar: make construction from integral explicit 2020-11-15 14:41:05 +01:00
gui Fix QImage::setPixelColor on RGBA64_Premultiplied 2020-12-04 15:09:47 +01:00
guiapplauncher Move QStateMachine from QtCore to QtScxml 2020-08-24 20:10:25 +02:00
installed_cmake
network tst_qnetworkreply: stabilize and unblacklist getFromHttpIntoBuffer2 2020-12-04 00:17:46 +01:00
opengl Remove tst_QGL 2020-08-28 11:43:11 +02:00
other Inline access to the QBindingStorage 2020-11-30 23:02:27 +00:00
printsupport Fit tst_qprinterinfo in case there are printers in local network 2020-11-21 06:11:37 +01:00
shared Remove most compiler warnings about missing overrides 2020-09-11 00:20:47 +02:00
sql Cleanup remaining QVariant::Type uses in Qt Sql 2020-10-17 12:01:54 +02:00
testlib Android: exclude faulty tst_selftests 2020-11-25 23:08:09 +02:00
tools Fix uic/rcc generating outdated export for Qt for Python 2020-12-04 15:46:04 +00:00
widgets Fix hashing of QPersistentModelIndex 2020-12-04 06:00:38 +00:00
xml QChar: make construction from integral explicit 2020-11-15 14:41:05 +01:00
.prev_CMakeLists.txt CMake: Regenerate projects 2020-09-22 19:08:53 +02:00
auto.pro Don't error out when configuring Qt on a headless system 2020-09-26 14:36:13 +02:00
CMakeLists.txt CMake: Fix building with -DQT_FEATURE_gui=OFF 2020-09-15 20:05:32 +02:00
network-settings.h Network self-test: make it work with docker/containers 2020-11-17 19:56:06 +01:00