Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/path_resolver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions test/test-filestat-set-times.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down