Skip to content

Commit 6a504e5

Browse files
authored
Fix sock_connect using wrong rights constant (#4849)
wasi_ssp_sock_connect checks __WASI_RIGHT_SOCK_BIND instead of __WASI_RIGHT_SOCK_CONNECT when validating file descriptor rights. This was a copy-paste error from wasi_ssp_sock_bind. As a result, connect operations check the wrong capability.
1 parent 9143b1a commit 6a504e5

File tree

1 file changed

+1
-1
lines changed
  • core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src

1 file changed

+1
-1
lines changed

core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2585,7 +2585,7 @@ wasi_ssp_sock_connect(wasm_exec_env_t exec_env, struct fd_table *curfds,
25852585
return __WASI_EACCES;
25862586
}
25872587

2588-
error = fd_object_get(curfds, &fo, fd, __WASI_RIGHT_SOCK_BIND, 0);
2588+
error = fd_object_get(curfds, &fo, fd, __WASI_RIGHT_SOCK_CONNECT, 0);
25892589
if (error != __WASI_ESUCCESS) {
25902590
return error;
25912591
}

0 commit comments

Comments
 (0)