Skip to content

Commit

Permalink
Limit the upper end of the rewind buffer to the current stack pointer…
Browse files Browse the repository at this point in the history
… so it doesn't overwrite stuff
  • Loading branch information
Arshia001 committed May 9, 2024
1 parent c92fee1 commit 4fa2687
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/wasix/src/syscalls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1142,9 +1142,7 @@ where
unwind_pointer + (std::mem::size_of::<__wasi_asyncify_t<M::Offset>>() as u64);
let unwind_data = __wasi_asyncify_t::<M::Offset> {
start: wasi_try_ok!(unwind_data_start.try_into().map_err(|_| Errno::Overflow)),
end: wasi_try_ok!(env
.layout
.stack_upper
end: wasi_try_ok!((env.layout.stack_upper - memory_stack.len() as u64)
.try_into()
.map_err(|_| Errno::Overflow)),
};
Expand Down

0 comments on commit 4fa2687

Please sign in to comment.