mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-10-07 10:54:01 +00:00
[libc][fix] Fix buffer overrun in initialization of GPU return value
Summary: The HSA API explicitly states that the size is a count of uint32_t's not a byte count. This was erroneously being used as a simple memcpy, causing some weird behaviour. Fix this by correctly passing `1` to initialize a single integer to zero.
This commit is contained in:
parent
65642c7308
commit
701e6f7630
@ -397,7 +397,7 @@ int load(int argc, char **argv, char **envp, void *image, size_t size,
|
||||
hsa_amd_memory_pool_allocate(coarsegrained_pool, sizeof(int),
|
||||
/*flags=*/0, &dev_ret))
|
||||
handle_error(err);
|
||||
hsa_amd_memory_fill(dev_ret, 0, sizeof(int));
|
||||
hsa_amd_memory_fill(dev_ret, 0, /*count=*/1);
|
||||
|
||||
// Allocate finegrained memory for the RPC server and client to share.
|
||||
uint32_t wavefront_size = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user