Skip to content

Reading into uninitialized buffers #81

Closed
@sunfishcode

Description

@sunfishcode

Currently, read takes a &mut [u8]. That's fine for many use cases, but it does require the buffer to be initialized before calling read, so it's currently not possible to read directly into uninitialized memory.

For Mustang, the C read API takes a raw pointer which may be pointing to an uninitialized buffer. Currently mustang does slice::from_raw_parts_mut, however this has undefined behavior if the slice is uninitialized.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestsemver bumpIssues that will require a semver-incompatible fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions