qt6-bb10/tests/auto/corelib/serialization
Marc Mutz 0808beace3 QBitArray: fix potential truncation in QDataStream op>>()
In Qt 5, a QBitArray could not contain more than INT_MAX bits, because
the then-size_type, int, cannot represent more, even if the underlying
storage could hold 8x as much, and the serialisation format, using
unsigned int, could represent 2x.

Therefore, reject old formats with sizes that exceed INT_MAX elements
as corrupt.

Likewise, the Qt 6 serialisation format unconditionally uses 64-bit
sizes, but 32-bit platforms still cannot represent more than
numeric_limits<qsizetype>::max() (= INT_MAX) bits in memory. This is a
valid stream for 64-bit platforms, though, so ideally, this should be
using SizeLimitsExeeded, which, however, is only available from Qt
6.7. So, for now, and until we have SizeLimitsExeeded, mark the stream
as corrupt here, too.

[ChangeLog][QtCore][QBitArray] Fixed undetected overflows in the
deserialisation (opertor>>()) from QDataStream.

Pick-to: 6.7 6.6 6.5 6.2 5.15
Change-Id: Ib24cf9218c06a3a05185723c77d4313611c2dd40
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-01-31 21:18:47 +01:00
..
json CMake: Make corelib tests standalone projects 2023-07-05 15:09:32 +02:00
qcborstreamreader QCborStreamReader: add UTF-8 reading API 2023-11-24 12:42:12 -08:00
qcborstreamwriter CI: Enable tests under corelib/serialization for Wasm platform 2023-08-14 16:08:32 +02:00
qcborvalue CI: Enable tests under corelib/serialization for Wasm platform 2023-08-14 16:08:32 +02:00
qcborvalue_json CMake: Make corelib tests standalone projects 2023-07-05 15:09:32 +02:00
qdatastream QBitArray: fix potential truncation in QDataStream op>>() 2024-01-31 21:18:47 +01:00
qdatastream_core_pixmap CI: Enable tests under corelib/serialization for Wasm platform 2023-08-14 16:08:32 +02:00
qtextstream Tests: remove blacklisted CIs no longer available 2023-12-06 22:07:44 +01:00
qxmlstream Fix renamed and duplicated namespaces in QXmlStreamWriter 2023-09-20 17:16:29 +02:00
CMakeLists.txt wasm tests: Disable unstable qcborvalue test 2023-11-23 19:26:49 +01:00
cborlargedatavalidation.cpp CI: Enable tests under corelib/serialization for Wasm platform 2023-08-14 16:08:32 +02:00