qt5base-lts/tests/auto/corelib/io
Marc Mutz 61157c8354 QBuffer: fix writing more than two GiB of data
In Qt 6, QByteArray can hold more than two GiB of data on 64-bit
platforms, so QBuffer should be able to handle writes of more than two
GiB, too. But the implementation didn't check for overflow and held
sizes in int variables, so it happily reported success but wrote data
only mod INT_MAX.

Fix by carefully avoiding overflow and using size variables of proper
type.

[ChangeLog][QtCore][QBuffer] Fixed silent data truncation when writing
more than two GiB at once on 64-bit platforms.

Pick-to: 6.3 6.2
Fixes: QTBUG-102171
Change-Id: Ib666f9f7db24495b4ed64191a48b35edc410f7e9
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-04-04 08:17:09 +02:00
..
largefile QNX: Limit maximum largefile size 2021-12-12 13:12:01 +02:00
qabstractfileengine Remove unused .qrc files 2022-01-17 23:17:01 +01:00
qbuffer QBuffer: fix writing more than two GiB of data 2022-04-04 08:17:09 +02:00
qdataurl qDecodeDataUrl(): treat ";base64" marker as case-insensitive 2022-03-11 19:15:49 +00:00
qdebug Remove the qmake project files 2021-01-07 15:32:28 +01:00
qdir Remove unused .qrc files 2022-01-17 23:17:01 +01:00
qdiriterator Tests: Do not depend on transitive includes 2022-03-17 17:14:37 +01:00
qfile Remove unused .qrc files 2022-01-17 23:17:01 +01:00
qfileinfo Add QFileInfo::isAlias() to reflect whether the file is a macOS alias 2022-03-06 18:46:54 +01:00
qfileselector CMake: Add BUILTIN_TESTDATA option to qt_internal_add_test 2022-02-11 21:54:44 +01:00
qfilesystementry CMake: Remove the usage of QT_SOURCE_TREE from tests 2021-07-12 18:56:14 +02:00
qfilesystemmetadata Remove the qmake project files 2021-01-07 15:32:28 +01:00
qfilesystemwatcher QFileSystemWatcher: Blacklist failing tests on macOS arm 2022-03-29 00:39:20 +00:00
qiodevice tst_QIODevice::unget() without network: skip only the affected part 2022-04-01 23:03:58 +02:00
qipaddress Disable security warnings from MSVC in tests 2021-03-17 17:22:00 +01:00
qlockfile Compile autotests for Integrity 2021-09-20 17:29:04 +03:00
qloggingcategory Tests: Do not depend on transitive includes 2022-03-17 17:14:37 +01:00
qloggingregistry Cleanup tests that add test data to resources explicitly 2022-02-11 21:54:44 +01:00
qnodebug Remove the qmake project files 2021-01-07 15:32:28 +01:00
qprocess QProcess/Unix: ensure we don't accidentally execute something from CWD 2022-02-09 11:26:32 -08:00
qprocess-noapplication Remove the qmake project files 2021-01-07 15:32:28 +01:00
qprocessenvironment QProcess: Distinguish between null and empty QProcessEnvironment 2021-11-07 01:53:44 +01:00
qresourceengine tst_qresourceengine: use QFINDTESTDATA() to find correct path 2022-02-04 11:02:07 +02:00
qsavefile QtBase: replace windows.h with qt_windows.h 2021-11-23 12:53:46 +08:00
qsettings QSettingsPrivate: fold from/to parameters into the view they bound 2022-03-30 21:37:24 +02:00
qstandardpaths Fix autotest public API compilation for INTEGRITY 2021-10-15 11:00:25 +03:00
qstorageinfo Remove the qmake project files 2021-01-07 15:32:28 +01:00
qtemporarydir Enable move semantics for QTemporaryDir 2022-03-18 20:56:19 +00:00
qtemporaryfile Remove unused .qrc files 2022-01-17 23:17:01 +01:00
qurl Workaround MSVC 2022 bug about QString::replace 2021-11-10 14:10:20 +01:00
qurlinternal tst_qurl{,internal}: Use U+FB01 for normalization to ASCII test cases 2021-08-25 00:13:39 +02:00
qurlquery tests: Remove unused SRCDIR defines 2021-08-17 12:41:57 +00:00
qurluts46 Tests: Do not depend on transitive includes 2022-03-17 17:14:37 +01:00
CMakeLists.txt Exclude filesystem autotests for INTEGRITY 2021-12-30 15:38:14 +00:00