Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace .get_unchecked_mut() with .as_mut_ptr().add() when accessing iso_packet_desc (fixes #199) #200

Merged
merged 1 commit into from Apr 15, 2024

Conversation

alufers
Copy link
Contributor

@alufers alufers commented Mar 30, 2024

This prevents panics on debug builds in new rust nightly versions (as of 2024-03-27), since they added bounds checks to get_unchecked_mut, which here was called on a zero-length slice representing a flexible array member. See: rust-lang/rust@2b43e75

TBH I am still learning rust, so if there is any better way of doing this let me know and I will change it.

…iso_packet_desc (fixes a1ien#199)

This prevents panics on debug builds in new rust nightly versions (as of 2024-03-27), since they added bounds checks to `get_unchecked_mut`, which here was called on a zero-length slice representing a flexible array member. See: rust-lang/rust@2b43e75
@alufers alufers force-pushed the fix/get-unchecked-mut-panics branch from 9035d01 to 4a69bca Compare March 30, 2024 23:31
@a1ien
Copy link
Owner

a1ien commented Apr 15, 2024

Looks good to me

@a1ien a1ien merged commit 03f6f53 into a1ien:master Apr 15, 2024
7 of 8 checks passed
@a1ien
Copy link
Owner

a1ien commented Apr 15, 2024

Merged. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants