Skip to content

Commit

Permalink
Merge pull request wasmerio#4490 from wasmerio/fix-for-panic
Browse files Browse the repository at this point in the history
Fix for a panic in the sock_recv when a file handle is missing
  • Loading branch information
john-sharratt authored Mar 15, 2024
2 parents 04ad072 + 7bf6e46 commit b17ce9a
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 b17ce9a

Please sign in to comment.