Skip to content

Commit

Permalink
fix AsByteSliceMut using raw pointers with bad provenance
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Apr 19, 2019
1 parent 852988b commit 90501dc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/lib.rs
Expand Up @@ -387,8 +387,7 @@ macro_rules! impl_as_byte_slice {
}
} else {
unsafe {
slice::from_raw_parts_mut(&mut self[0]
as *mut $t
slice::from_raw_parts_mut(self.as_mut_ptr()
as *mut u8,
self.len() * mem::size_of::<$t>()
)
Expand Down

0 comments on commit 90501dc

Please sign in to comment.