You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
I pushed a PR that addresses the issue. It's just a matter of explicitly checking for null pointers. In the process I also noticed that the rust crate points to a rather old commit of the C repo.
I suspect there is a bug in the library. In particular at line:
spirv-reflect-rs/src/convert.rs
Line 66 in b2c4527
It seems like it is possible for
ffi_type.members
to be null ifffi_type.member_count
is 0. However, rust considers this unsafe and will return the error: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)
The text was updated successfully, but these errors were encountered: