Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@josephlr

Description

@josephlr

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions