Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Soundness: Reads from padding bytes of unions in generated Debug impl #45

Open
@Manishearth

Description

let size = ::core::mem::size_of::<Self>();
let data = unsafe { ::core::slice::from_raw_parts(self as *const Self as *const u8, size) };
builder.field(&data);
builder.finish()

This is unsound: there is no guarantee those bytes are readable.

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

        AltStyle によって変換されたページ (->オリジナル) /