Skip to content

Null pointer causing crash in debug builds. #24

Description

@Makogan

I suspect there is a bug in the library. In particular at line:

let ffi_members =

It seems like it is possible for ffi_type.members to be null if ffi_type.member_count is 0. However, rust considers this unsafe and will return the error:

unsafe precondition(s) violated: slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX`

Thus no application using this crate can run correctly in debug mode.

OS: ubuntu 22.04
crate version: 0.2.3
rustc version: rustc 1.78.0-nightly (ef324565d 2024-02-27)

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