Skip to content
This repository was archived by the owner on May 9, 2022. It is now read-only.
This repository was archived by the owner on May 9, 2022. It is now read-only.

Illegal use of mem::zeroed() #18

@RalfJung

Description

@RalfJung

The use of mem::zeroed at

looks illegal: mem::zeroed may only be used for types that actually allow zero-initialization, and here this is done for any user-controlled type T. So, e.g. if T is a reference, this is UB as references must not be all-zero.

If you just want to write a bunch of zero bytes to memory, I suggest using write_bytes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions