diff --git a/src/path_resolver.c b/src/path_resolver.c index 8a73f03..e36ed1a 100644 --- a/src/path_resolver.c +++ b/src/path_resolver.c @@ -445,6 +445,11 @@ uvwasi_errno_t uvwasi__resolve_path(const uvwasi_t* uvwasi, normalized_parent = NULL; resolved_link_target = NULL; + if (input_len == 0) { + *resolved_path = NULL; + return UVWASI_ENOENT; + } + if (uvwasi__is_absolute_path(input, input_len)) { *resolved_path = NULL; return UVWASI_ENOTCAPABLE; diff --git a/test/test-filestat-set-times.c b/test/test-filestat-set-times.c index ce779fc..8841300 100644 --- a/test/test-filestat-set-times.c +++ b/test/test-filestat-set-times.c @@ -74,6 +74,9 @@ int main(void) { assert(err == 0); /* Stat the file to get initial times. */ + err = uvwasi_path_filestat_get(&uvwasi, 3, 0, path, 0, &stats2); + assert(err == UVWASI_ENOENT); + err = uvwasi_fd_filestat_get(&uvwasi, fd, &stats); assert(err == 0); assert(stats.st_filetype == UVWASI_FILETYPE_REGULAR_FILE);