mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 08:37:13 +09:00
A DWORD is the maximum CryptGenRandom() can support.
This commit is contained in:
@@ -169,7 +169,9 @@ randombytes_sysrandom_buf(void * const buf, const size_t size)
|
||||
abort();
|
||||
}
|
||||
#else
|
||||
// Is cast from size_t to DWORD safe here?
|
||||
if (size > 0xffffffff) {
|
||||
abort();
|
||||
}
|
||||
if (! CryptGenRandom(stream.hcrypt_prov, (DWORD) size, (BYTE *) buf)) {
|
||||
abort();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user