syscalls: stat: fix temporary pathname allocation

This commit is contained in:
Matheus
2022-10-13 13:32:14 -03:00
parent 8efd2fc0e3
commit 25069f140a
+1 -2
View File
@@ -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;