From 25069f140aea431637512ef8f092de94beb86ded Mon Sep 17 00:00:00 2001 From: Matheus Date: Thu, 13 Oct 2022 13:32:14 -0300 Subject: [PATCH] syscalls: stat: fix temporary pathname allocation --- 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 9e09b28c..331b6a19 100644 --- a/src/sys/syscalls/stat.c +++ b/src/sys/syscalls/stat.c @@ -17,7 +17,7 @@ syscallret syscall_stat(const char* path, stat* st){ return retv; } - char* kpath = alloc(strlen(path)); // XXX use proper user strlen func + char* kpath = alloc(strlen(path)+1); // XXX use proper user strlen func if(!kpath){ retv.errno = ENOMEM; @@ -32,7 +32,6 @@ syscallret syscall_stat(const char* path, stat* st){ int ret = vfs_open(&file, *kpath == '/' ? proc->root : proc->cwd, kpath); - if(ret){ retv.errno = ret; goto _ret;