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
// Keep this in a central place to allow for future optimization
#[inline(always)]
pubfnmemset(slice:&mut[u8],value:u8){
let p = slice.as_mut_ptr();
unsafe{
ptr::write_bytes(p, value, slice.len());
}
}
The unsafe function called needs to ensure that the parameter must be:
dst must be valid for writes of count * size_of::() bytes.
dst must be properly aligned. https://doc.rust-lang.org/std/ptr/fn.write_bytes.html
and the developer who calls the ref_as_nonnull function may not notice this safety requirement.
Marking them unsafe also means that callers must make sure they know what they're doing.
The text was updated successfully, but these errors were encountered:
Hello, I found a soundness issue in this crate.
ckb-vm/src/memory/mod.rs
Lines 131 to 138 in 1642d8f
The unsafe function called needs to ensure that the parameter must be:
https://doc.rust-lang.org/std/ptr/fn.write_bytes.html
and the developer who calls the ref_as_nonnull function may not notice this safety requirement.
Marking them unsafe also means that callers must make sure they know what they're doing.
The text was updated successfully, but these errors were encountered: