Windows: buffer uninitialized if longer than 2^32 bytes #31
Closed
Description
The Windows implementation for getrandom_inner()
calls RtlGenRandom
. However, the length parameter is a ULONG
(i.e. a u32
).
Thus, if a buffer of length 2^32
is passed to getrandom()
on Windows, the call dest.len() as ULONG
truncates the value to 0. This results in the function seeming to succeed, but without writing any data.
Thanks to @briansmith's ring implementation, for pointing this out.
Metadata
Assignees
Labels
No labels