mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 21:50:12 +01:00
rusticl/disk_cache: fix stack corruption
The length passed to mesa_bytes_to_hex is the one of the input, not output
data.
Fixes: fbe9a7ca3e ("rusticl/mesa: create proper build-id hash for the disk cache")
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24967>
This commit is contained in:
parent
bcc0ec8e6c
commit
1a20ac7891
1 changed files with 1 additions and 5 deletions
|
|
@ -89,11 +89,7 @@ impl DiskCache {
|
|||
}
|
||||
}
|
||||
SHA1Final(&mut sha, &mut sha_ctx);
|
||||
mesa_bytes_to_hex(
|
||||
cache_id.as_mut_ptr(),
|
||||
sha.as_ptr(),
|
||||
(cache_id.len() - 1) as u32,
|
||||
);
|
||||
mesa_bytes_to_hex(cache_id.as_mut_ptr(), sha.as_ptr(), sha.len() as u32);
|
||||
disk_cache_create(c_name.as_ptr(), cache_id.as_ptr(), flags)
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue