diff options
author | Dimitrios Apostolou <jimis@qt.io> | 2022-04-09 00:06:22 +0200 |
---|---|---|
committer | Dimitrios Apostolou <jimis@qt.io> | 2022-04-12 00:48:17 +0200 |
commit | b8677bd31fdb8e0cc897dcd4e39e121baa3e9722 (patch) | |
tree | 6b3af36f070209602c170db9093925dd66e6b217 /util/cmake/README.md | |
parent | f9f10857354a0775730595ce1e7a435b62bd1bf9 (diff) |
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>
Diffstat (limited to 'util/cmake/README.md')
0 files changed, 0 insertions, 0 deletions