Skip to content

Conversation

@kitcatier
Copy link

@kitcatier kitcatier commented Mar 20, 2023

rust-crypto/src/util.rs

Lines 32 to 39 in cc1a5fd

pub fn secure_memset(dst: &mut [u8], val: u8) {
unsafe {
rust_crypto_util_secure_memset(
dst.as_mut_ptr(),
val,
dst.len() as libc::size_t);
}
}

Hello, if a function's entire body is unsafe, the function is itself unsafe and should be marked appropriately, which will make the caller ignore the safety requirements that the function parameters must guarantee, the developer who calls the secure_memset function may not notice this safety requirement.

Marking them unsafe also means that callers must make sure they know what they're doing.

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