diff options
author | Marc Mutz <[email protected]> | 2024-03-25 17:55:57 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <[email protected]> | 2024-04-28 08:38:15 +0000 |
commit | 21d8f6685ef250c9fe5f347e8b79b8cfb7650436 (patch) | |
tree | e6cfe0c18b6448578cee49f420cf7446c9085098 | |
parent | 8f8de922eca1a6a8b1131e1c7978c66ec410e3db (diff) |
QRhiVulkan: fix random values in pipelineCacheData() result
The QVkPipelineCacheDataHeader::reserved field wasn't initializaed by
the code, but then memcpy()ed with the struct into the result
QByteArray. At best, this contains random data, at worst, it leaks
information.
Initialize it to zero.
Found by Coverity.
Amends df0e98d4080f50de7ecacdc4cae079ab31280481.
Pick-to: 6.2
Coverity-Id: 444147
Change-Id: I398c9a1e99483f2f9887d768319b20ecc11e2c86
Reviewed-by: Giuseppe D'Angelo <[email protected]>
(cherry picked from commit 2913e7de5186fc4fd3576167304c214d30f78d2e)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
(cherry picked from commit bed03c10be8a93debfa0ee00c544efb2d966b742)
(cherry picked from commit 1d54d0252c7647a948415ac7780305b690a7ec3b)
-rw-r--r-- | src/gui/rhi/qrhivulkan.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/rhi/qrhivulkan.cpp b/src/gui/rhi/qrhivulkan.cpp index c6ecd8a2fba..63a7b5b5b4b 100644 --- a/src/gui/rhi/qrhivulkan.cpp +++ b/src/gui/rhi/qrhivulkan.cpp @@ -4388,6 +4388,7 @@ QByteArray QRhiVulkan::pipelineCacheData() header.deviceId = physDevProperties.deviceID; header.dataSize = quint32(dataSize); header.uuidSize = VK_UUID_SIZE; + header.reserved = 0; memcpy(data.data(), &header, headerSize); memcpy(data.data() + headerSize, physDevProperties.pipelineCacheUUID, VK_UUID_SIZE); |