Skip to content

Windows: buffer uninitialized if longer than 2^32 bytes #31

Closed
@josephlr

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions