Skip to content

CmsgSpace::new unsafely creates uninitialized, arbitrary types #994

Closed
@goffrie

Description

@goffrie

Even though the uninitialized field is private, it still gets dropped. For example nix::sys::socket::CmsgSpace::<String>::new(); easily causes a segfault.

The field should probably be ManuallyDrop<T>, or there should be a T: Copy bound.

Metadata

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