qt5base-lts/tests/auto/corelib/text
Mårten Nordheim 4660a230d5 QString/QByteArray: fix append() wrt. raw data
When appending to an empty string or byte array, we optimize and
copy the internal pointer. But if the other string/byte array was
created with fromRawData this might be temporary data on the stack/heap
and might be de-allocated or overwritten before the string/byte array
is used or is forced to make a deep-copy. This would lead to incorrect
data being used.

This is easy to overlook if you plan to append multiple strings
together, potentially supplied through an argument. Upon appending a
second string it would make a full copy, but there might not be a
guarantee for that. So, it's hard for users to avoid this pitfall!

Fixes: QTBUG-115752
Pick-to: 6.6 6.5 6.2
Change-Id: Ia9aa5f463121c2ce2e0e8eee8a6c8612b7297f2b
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-08-21 23:27:56 +02:00
..
qanystringview QAnyStringView: add QDebug stream operator 2023-07-06 02:18:38 +00:00
qbytearray QString/QByteArray: fix append() wrt. raw data 2023-08-21 23:27:56 +02:00
qbytearray_large CI: Enable tests under corelib/text for Wasm platform 2023-07-10 14:53:34 +02:00
qbytearrayapisymmetry CMake: Make corelib tests standalone projects 2023-07-05 15:09:32 +02:00
qbytearraylist CMake: Make corelib tests standalone projects 2023-07-05 15:09:32 +02:00
qbytearraymatcher CMake: remove check for cxx11_future 2023-08-02 12:36:18 -07:00
qbytearrayview String-like containers: add implicit conversions towards std:: string views 2023-07-13 16:19:06 +02:00
qbytedatabuffer CMake: Make corelib tests standalone projects 2023-07-05 15:09:32 +02:00
qchar CMake: Make corelib tests standalone projects 2023-07-05 15:09:32 +02:00
qcollator CI: Enable tests under corelib/text for Wasm platform 2023-07-10 14:53:34 +02:00
qlatin1stringmatcher CMake: remove check for cxx11_future 2023-08-02 12:36:18 -07:00
qlatin1stringview CMake: Make corelib tests standalone projects 2023-07-05 15:09:32 +02:00
qlocale Give QLocale's name() and bcp47Name() separator parameters 2023-08-18 18:39:14 +02:00
qregularexpression CMake: Make corelib tests standalone projects 2023-07-05 15:09:32 +02:00
qstring QString/QByteArray: fix append() wrt. raw data 2023-08-21 23:27:56 +02:00
qstring_no_cast_from_bytearray CMake: Make corelib tests standalone projects 2023-07-05 15:09:32 +02:00
qstringapisymmetry CI: Enable tests under corelib/text for Wasm platform 2023-07-10 14:53:34 +02:00
qstringbuilder QStringBuilder: test more concatenation variants 2023-07-24 01:04:55 +03:00
qstringconverter Provide QStringConverter equivalent of QTextCodec::availableCodecs 2023-07-18 09:38:38 +03:00
qstringiterator CMake: Make corelib tests standalone projects 2023-07-05 15:09:32 +02:00
qstringlist CMake: Make corelib tests standalone projects 2023-07-05 15:09:32 +02:00
qstringmatcher CMake: Make corelib tests standalone projects 2023-07-05 15:09:32 +02:00
qstringtokenizer CI: Enable tests under corelib/text for Wasm platform 2023-07-10 14:53:34 +02:00
qstringview String-like containers: add implicit conversions towards std:: string views 2023-07-13 16:19:06 +02:00
qtextboundaryfinder tst_QTextBoundaryFinder: clean out the last two foreach uses 2023-08-11 19:58:01 +02:00
qunicodetools CMake: Make corelib tests standalone projects 2023-07-05 15:09:32 +02:00
shared Provide optTitle for a NumberDoubleTestData testcase that needs it 2022-10-11 11:21:38 +02:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00