mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-29 05:55:16 -04:00
memcpy(x, NULL, 0) is undefined behavior
This commit is contained in:
parent
3d8ff446ad
commit
b35c418558
7 changed files with 31 additions and 13 deletions
|
@ -91,7 +91,9 @@ uint32_t user_get_random_bytes(smc_args_t *args) {
|
|||
se_generate_random(KEYSLOT_SWITCH_RNGKEY, random_bytes, size);
|
||||
flush_dcache_range(random_bytes, random_bytes + size);
|
||||
|
||||
memcpy(&args->X[1], random_bytes, size);
|
||||
if (size != 0) {
|
||||
memcpy(&args->X[1], random_bytes, size);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue