MCPcopy Create free account
hub / github.com/PLSysSec/wave / copy_buf_to_sandbox

Method copy_buf_to_sandbox

src/runtime.rs:145–156  ·  view source on GitHub ↗
(
        &mut self,
        dst: SboxPtr,
        src: &Vec<u8>,
        n: u32,
    )

Source from the content-addressed store, hash-verified

143 #[ensures(trace_safe(trace, self))]
144 #[ensures(self.memlen == old(self.memlen))]
145 pub fn copy_buf_to_sandbox(
146 &mut self,
147 dst: SboxPtr,
148 src: &Vec<u8>,
149 n: u32,
150 ) -> RuntimeResult<()> {
151 if src.len() < n as usize || !self.fits_in_lin_mem(dst, n) {
152 return Err(Efault);
153 }
154 self.memcpy_to_sandbox(dst, src, n);
155 Ok(())
156 }
157
158 /// Copy arg buffer from from host to sandbox
159 #[with_ghost_var(trace: &mut Trace)]

Callers 2

wasi_prestat_dirnameFunction · 0.80
wasi_fd_readdirFunction · 0.80

Calls 3

fits_in_lin_memMethod · 0.80
memcpy_to_sandboxMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected