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

Safer handling of DeviceType value coming from FFI #90

Merged
merged 2 commits into from
Oct 30, 2024

Conversation

simon-wh
Copy link
Member

Superseeds #85 as the root cause turned out to be invalid device_type value coming from a C plugin causing undefined behaviour.

Seemingly in general it's risky to take enums from C straight up into Rust, as funky things happen (undefined behaviour) when invalid enum values come in from the C side (Some talk on this here: https://users.rust-lang.org/t/guarding-against-invalid-enum-values-arriving-via-ffi/33482)

@simon-wh simon-wh merged commit 5a746bf into develop Oct 30, 2024
2 checks passed
@simon-wh simon-wh deleted the fix/validate-ffi-device-type branch October 30, 2024 15:25
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.

1 participant