This patch also reverts the commit a0dcf8530c352536ab6633952b6f614f73eed154.
Signed-off-by: Waldemar Kozaczuk <jwkozac...@gmail.com> --- fs/vfs/main.cc | 5 ----- fs/vfs/vfs_syscalls.cc | 4 ---- fs/vfs/vfs_task.cc | 4 ++++ 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/fs/vfs/main.cc b/fs/vfs/main.cc index 889aa268..4adf4434 100644 --- a/fs/vfs/main.cc +++ b/fs/vfs/main.cc @@ -120,11 +120,6 @@ int open(const char *pathname, int flags, ...) int fd, error; int acc; - if (pathname == nullptr) { - error = EFAULT; - goto out_errno; - } - acc = 0; switch (flags & O_ACCMODE) { case O_RDONLY: diff --git a/fs/vfs/vfs_syscalls.cc b/fs/vfs/vfs_syscalls.cc index d9bb18fc..487d5729 100644 --- a/fs/vfs/vfs_syscalls.cc +++ b/fs/vfs/vfs_syscalls.cc @@ -117,10 +117,6 @@ sys_open(char *path, int flags, mode_t mode, struct file **fpp) DPRINTF(VFSDB_SYSCALL, ("sys_open: path=%s flags=%x mode=%x\n", path, flags, mode)); - if (path == nullptr) { - return (EFAULT); - } - flags = fflags(flags); if (flags & O_CREAT) { error = namei(path, &dp); diff --git a/fs/vfs/vfs_task.cc b/fs/vfs/vfs_task.cc index 7a355034..332c460d 100644 --- a/fs/vfs/vfs_task.cc +++ b/fs/vfs/vfs_task.cc @@ -146,6 +146,10 @@ task_conv(struct task *t, const char *cpath, int acc, char *full) { int rc; + if (cpath == nullptr) { + return (EFAULT); + } + rc = path_conv(t->t_cwd, cpath, full); if (rc != 0) { return (rc); -- 2.20.1 -- You received this message because you are subscribed to the Google Groups "OSv Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/osv-dev/20190519204728.16752-1-jwkozaczuk%40gmail.com. For more options, visit https://groups.google.com/d/optout.