bbd1f576f7
In qCompress, we've been calculating postive len values out of them, only to fail at random points later, possibly running into UB. Fail early instead. In qUncompress, we've been catching negative values, and reported them indiscriminately as "invalid data". Use a better warning message instead. By rights, nbytes ≥ 0 would be a precondition of both functions (which we would Q_ASSERT() on), but seeing we're picking this back into LTS branches, I found it prudent to use a non-fatal way to signal the precondition violation. If and when we keep these functions for Qt 7, it will be as an overload that takes QByteArrayView, in which case nbytes ≥ 0 enters as a hard precondition via the QByteArrayView constructor, so there appears to be no need to pre-program a Q_ASSERT() for Qt 7.0. Pick-to: 6.4 6.3 6.2 Task-number: QTBUG-104972 Task-number: QTBUG-106542 Change-Id: I6a1b25fe12d31e3d4c845033cad320832976f83c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> |
||
---|---|---|
.github/workflows | ||
bin | ||
cmake | ||
coin | ||
config.tests | ||
dist | ||
doc | ||
examples | ||
lib | ||
libexec | ||
LICENSES | ||
mkspecs | ||
qmake | ||
src | ||
tests | ||
util | ||
.cmake.conf | ||
.gitattributes | ||
.gitignore | ||
.lgtm.yml | ||
.tag | ||
CMakeLists.txt | ||
conanfile.py | ||
config_help.txt | ||
configure | ||
configure.bat | ||
configure.cmake | ||
dependencies.yaml | ||
qt_cmdline.cmake | ||
sync.profile |