summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2024-03-25 17:55:57 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-04-01 12:18:47 +0000
commit1d54d0252c7647a948415ac7780305b690a7ec3b (patch)
tree26539c31f492dcda3b4cacf286b02eebcae543fb
parent29a75b99f43ce704ec68fc1650047c9db2fb2829 (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.5 6.2 Coverity-Id: 444147 Change-Id: I398c9a1e99483f2f9887d768319b20ecc11e2c86 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit 2913e7de5186fc4fd3576167304c214d30f78d2e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit bed03c10be8a93debfa0ee00c544efb2d966b742)
-rw-r--r--src/gui/rhi/qrhivulkan.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/rhi/qrhivulkan.cpp b/src/gui/rhi/qrhivulkan.cpp
index 4924207100..42767fc7be 100644
--- a/src/gui/rhi/qrhivulkan.cpp
+++ b/src/gui/rhi/qrhivulkan.cpp
@@ -4569,6 +4569,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);