Skip to content

Commit

Permalink
deps: update to uvwasi 0.0.13
Browse files Browse the repository at this point in the history
Notable changes:

- A bug has been fixed in `uvwasi_fd_readdir()` that caused
  the number of entries to be processed incorrectly.

PR-URL: nodejs/node#44524
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
  • Loading branch information
cjihrig authored and guangwong committed Jan 3, 2023
1 parent e959bb8 commit b5118f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deps/uvwasi/include/uvwasi.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ extern "C" {

#define UVWASI_VERSION_MAJOR 0
#define UVWASI_VERSION_MINOR 0
#define UVWASI_VERSION_PATCH 12
#define UVWASI_VERSION_PATCH 13
#define UVWASI_VERSION_HEX ((UVWASI_VERSION_MAJOR << 16) | \
(UVWASI_VERSION_MINOR << 8) | \
(UVWASI_VERSION_PATCH))
Expand Down
8 changes: 7 additions & 1 deletion deps/uvwasi/src/uvwasi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1384,8 +1384,14 @@ uvwasi_errno_t uvwasi_fd_readdir(uvwasi_t* uvwasi,
}

/* Write dirent to the buffer if it will fit. */
if (UVWASI_SERDES_SIZE_dirent_t + *bufused > buf_len)
if (UVWASI_SERDES_SIZE_dirent_t + *bufused > buf_len) {
/* If there are more entries to be written to the buffer we set
* bufused, which is the return value, to the length of the buffer
* which indicates that there are more entries to be read.
*/
*bufused = buf_len;
break;
}

uvwasi_serdes_write_dirent_t(buf, *bufused, &dirent);
*bufused += UVWASI_SERDES_SIZE_dirent_t;
Expand Down

0 comments on commit b5118f1

Please sign in to comment.