qt6-bb10/src
Dimitrios Apostolou b8677bd31f Fix use-after-free because QByteArray::data() was copying data
Previously there was a mixture of buf.constData() and buf.data() with
buf not being const QByteArray. As a result, buf.data() returned a
re-allocated buffer and texData was keeping pointers to that one, which
became invalid once the function returned and the re-allocated buffer
was cleaned up by destructor.

Change buf to const QByteArray so that there is no difference between
data() and constData(). Additionally convert all constData() calls to
data() to avoid confusion.

Detected by Address Sanitizer on testcase
  tst_qtexturefilereader::checkMetadata()

Pick-to: 6.3 6.2
Change-Id: Idb6f6141898678bf95ed9233a92b7bb3ad12e250
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-04-12 00:48:17 +02:00
..
3rdparty Update bundled zlib to version 1.2.12 2022-03-31 08:43:56 +02:00
android Android: fix fullscreen handling 2022-03-29 13:56:14 +01:00
concurrent Do not highlight the Image Scaling Example anymore in Qt Creator 2022-02-17 18:16:42 +01:00
corelib Annotate QMutex with TSAN annotations 2022-04-11 23:26:01 +02:00
dbus QtDBus: optimize handling of isDebugging 2022-04-03 16:18:43 +02:00
entrypoint QtBase: replace windows.h with qt_windows.h 2021-11-23 12:53:46 +08:00
gui Fix use-after-free because QByteArray::data() was copying data 2022-04-12 00:48:17 +02:00
network Network[doc]: Update Qt6-changes for QNetworkInformation in 6.3 2022-04-07 14:05:04 +02:00
opengl Rest of QtBase: sweep Q_DECLARE_METATYPE → QT_DECL_METATYPE_EXTERN 2022-04-07 01:29:24 +02:00
openglwidgets Compose render-to-texture widgets through QRhi 2022-03-11 21:25:00 +01:00
platformsupport Misc: Do not depend on transitive includes 2022-03-17 17:14:37 +01:00
plugins xcb: get geometry correctly for rotation with RAndR 1.5 2022-04-08 18:30:17 +00:00
printsupport Rest of QtBase: sweep Q_DECLARE_METATYPE → QT_DECL_METATYPE_EXTERN 2022-04-07 01:29:24 +02:00
sql Sql: Do not depend on transitive includes 2022-03-17 17:14:37 +01:00
testlib Replace uses of _qba with _ba 2022-04-07 19:30:17 +02:00
tools Android: fix androidtestrunner failure parsing 2022-04-06 14:50:17 +03:00
widgets QProxyStyle: reimplement event() handling 2022-04-09 00:15:29 +02:00
xml QDom: optimize an atomic read 2022-04-06 10:44:40 +00:00
CMakeLists.txt Make it possible to disable the PrintSupport module 2021-02-09 09:17:21 +01:00