Verified Commit 4818ad61 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Always zero mmap'd memory

parent 886f859b
......@@ -156,6 +156,7 @@ impl Tcb {
{
return Err(Error::Malformed(format!("failed to map tls")));
}
ptr::write_bytes(ptr as *mut u8, 0, size);
Ok(slice::from_raw_parts_mut(ptr as *mut u8, size))
}
......
......@@ -116,6 +116,7 @@ pub unsafe extern "C" fn pte_osThreadCreate(
if stack_base as isize == -1 {
return PTE_OS_GENERAL_FAILURE;
}
ptr::write_bytes(stack_base as *mut u8, 0, stack_size);
let stack_end = stack_base.add(stack_size);
let mut stack = stack_end as *mut usize;
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment