Fix invalid calculation of total size of bytes to send and recv (#1162)

The total size of bytes to send and recv should be set to 0 before calculation,
but not including the size of iovec_app_t structure.
This commit is contained in:
liang.he
2022-05-10 10:43:34 +08:00
committed by GitHub
parent 3ba2d7e7de
commit ceaf7dc660
3 changed files with 10 additions and 9 deletions

View File

@ -154,8 +154,8 @@ recvmsg(int sockfd, struct msghdr *msg, int flags)
// Prepare input parameters.
__wasi_iovec_t *ri_data = NULL;
size_t i = 0;
size_t ro_datalen;
__wasi_roflags_t ro_flags;
size_t ro_datalen = 0;
__wasi_roflags_t ro_flags = 0;
if (NULL == msg) {
HANDLE_ERROR(__WASI_ERRNO_INVAL)