Function cobhan::cbuffer_to_vector

source ·
pub unsafe fn cbuffer_to_vector(buffer: *const c_char) -> Result<Vec<u8>, i32>
Expand description

Takes a pointer to an external Cobhan Buffer and fallibly attempts to interpret it as a Vec<u8>.

Notes

This function does a memcopy from the provided Cobhan Buffer into Rust owned data.

Safety

Behavior is undefined if any of the following conditions are violated:

  • The Cobhan Buffer Header size is not correctly reserved or formatted.
  • Any of the Safety conditions of std::slice::from_raw_parts is violated.