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

iOS only: security_framework::passwords::get_password_and_release crashes on empty password #206

Closed
brotskydotcom opened this issue Jul 14, 2024 · 0 comments · Fixed by #207

Comments

@brotskydotcom
Copy link
Contributor

brotskydotcom commented Jul 14, 2024

On Rust 1.79.0, line 163 in passwords.rs

vec.extend_from_slice(val.bytes());

crashes if val is empty, with the message:

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

This can easily be reproduced if the existing generic_roundtrip test is modified to use an empty password string.

This bug doesn't exist on macOS, because the macOS-specific implementation doesn't retrieve data using this function.

@brotskydotcom brotskydotcom changed the title security_framework::passwords::get_password_and_release crashes on empty password iOS only: security_framework::passwords::get_password_and_release crashes on empty password Jul 14, 2024
ancwrd1 pushed a commit to ancwrd1/rust-security-framework that referenced this issue Sep 14, 2024
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 a pull request may close this issue.

1 participant