summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2024-03-25 17:55:57 +0100
committerMarc Mutz <marc.mutz@qt.io>2024-03-27 15:49:43 +0000
commit2913e7de5186fc4fd3576167304c214d30f78d2e (patch)
treed90c3a4ab82019ac46da71d40b0133f0780c7abb /src/gui
parent6aec89c5fb7d0b76a496c9391747f3bfae38d4ac (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.7 6.6 6.5 6.2 Coverity-Id: 444147 Change-Id: I398c9a1e99483f2f9887d768319b20ecc11e2c86 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/gui')
-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 41a0e7ba71..da8c8fc52a 100644
--- a/src/gui/rhi/qrhivulkan.cpp
+++ b/src/gui/rhi/qrhivulkan.cpp
@@ -4724,6 +4724,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);