Skip to content

Commit

Permalink
Fix for a panic in the sock_recv when a file handle is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
john-sharratt committed Mar 14, 2024
1 parent 04ad072 commit 7bf6e46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/wasix/src/syscalls/wasix/sock_recv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub fn sock_recv<M: MemorySize>(
ro_flags: WasmPtr<RoFlags, M>,
) -> Result<Errno, WasiError> {
let env = ctx.data();
let fd_entry = env.state.fs.get_fd(sock).unwrap();
let fd_entry = wasi_try_ok!(env.state.fs.get_fd(sock));
let guard = fd_entry.inode.read();
let use_read = matches!(guard.deref(), Kind::Pipe { .. });
drop(guard);
Expand Down

0 comments on commit 7bf6e46

Please sign in to comment.