From 3066fdbb4f2fcee90378af4b3b7b28e92cacc6ed Mon Sep 17 00:00:00 2001 From: Matheus Date: Sun, 28 Aug 2022 22:44:37 -0300 Subject: [PATCH] syscalls: stat: add another case that returns EFAULT --- src/sys/syscalls/stat.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sys/syscalls/stat.c b/src/sys/syscalls/stat.c index 278b65b2..b5ac5cf9 100644 --- a/src/sys/syscalls/stat.c +++ b/src/sys/syscalls/stat.c @@ -12,8 +12,7 @@ syscallret syscall_stat(const char* path, stat* st){ syscallret retv; retv.ret = -1; - - if(st > USER_SPACE_END){ + if(st > USER_SPACE_END || path > USER_SPACE_END){ retv.errno = EFAULT; return retv; }