Skip to main content

zeroize_mut_byteslice

Function zeroize_mut_byteslice 

Source
pub unsafe fn zeroize_mut_byteslice<'a>(
    ptr: *mut u8,
    capacity: usize,
) -> &'a mut [u8] ⓘ
Expand description

Sanitize the data pointer and length and reconstitute the mutable slice.

This method will zeroize the content.

This method returns an empty slice if the length is 0.

§Safety

Caller must ensure that

  • ptr outlives 'a.
  • access to out is exclusive and strictly not aliased.
  • if ptr is NULL, capacity == 0.