radv: don't pass null to _mesa_sha1_update
This could then pass NULL to memcpy. Fixes UBSan error: ../src/util/sha1/sha1.c:140:8: runtime error: null pointer passed as argument 2, which is declared to never be null Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6206>
This commit is contained in:
@@ -133,7 +133,7 @@ radv_hash_shaders(unsigned char *hash,
|
||||
|
||||
_mesa_sha1_update(&ctx, module->sha1, sizeof(module->sha1));
|
||||
_mesa_sha1_update(&ctx, stages[i]->pName, strlen(stages[i]->pName));
|
||||
if (spec_info) {
|
||||
if (spec_info && spec_info->mapEntryCount) {
|
||||
_mesa_sha1_update(&ctx, spec_info->pMapEntries,
|
||||
spec_info->mapEntryCount * sizeof spec_info->pMapEntries[0]);
|
||||
_mesa_sha1_update(&ctx, spec_info->pData, spec_info->dataSize);
|
||||
|
||||
Reference in New Issue
Block a user