summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/serialization/cborlargedatavalidation.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QCborValue: catch overflow in QByteArray when decoding chunked stringsThiago Macieira2020-05-071-4/+16
| | | | | | | | | | We checked against integer overflow, but not against overflowing the QByteArray size limit. That caused a std::bad_alloc to be thrown, which is bad when decoding unknown data. QCborStreamReader wasn't affected, since it doesn't merge chunks. Change-Id: I99ab0f318b1c43b89888fffd160c36f495fada87 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CBOR support: prevent overflowing QByteArray's max allocationThiago Macieira2020-03-271-0/+134
QByteArray doesn't like it. Apply the same protection to QString, which we know uses the same backend but uses elements twice as big. That means it can contain slightly more than half as many elements, but exact half will suffice for our needs. Change-Id: Iaa63461109844e978376fffd15f9d4c7a9137856 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>