From 3cc8f4bb56125532af0d3f88a72d5244cb6e1adc Mon Sep 17 00:00:00 2001 From: cjihrig Date: Mon, 5 Sep 2022 15:28:01 -0400 Subject: [PATCH] deps: update to uvwasi 0.0.13 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Notable changes: - A bug has been fixed in `uvwasi_fd_readdir()` that caused the number of entries to be processed incorrectly. PR-URL: https://github.com/nodejs/node/pull/44524 Reviewed-By: Luigi Pinca Reviewed-By: Tobias Nießen Reviewed-By: Rich Trott Reviewed-By: Mohammed Keyvanzadeh --- deps/uvwasi/include/uvwasi.h | 2 +- deps/uvwasi/src/uvwasi.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/deps/uvwasi/include/uvwasi.h b/deps/uvwasi/include/uvwasi.h index 28d38568612607..b45f80b1908ee4 100644 --- a/deps/uvwasi/include/uvwasi.h +++ b/deps/uvwasi/include/uvwasi.h @@ -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)) diff --git a/deps/uvwasi/src/uvwasi.c b/deps/uvwasi/src/uvwasi.c index 25ce4ab846ef86..18885ee25961a6 100644 --- a/deps/uvwasi/src/uvwasi.c +++ b/deps/uvwasi/src/uvwasi.c @@ -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;