open: fix no out of memory check

This commit is contained in:
Matheus
2023-07-23 00:58:10 -03:00
parent c1e7ef84ce
commit df89cc1c63
+5
View File
@@ -19,6 +19,11 @@ syscallret_t syscall_openat(context_t *context, int dirfd, const char *path, int
size_t pathsize = strlen(path); // TODO u_strlen
char *pathbuf = alloc(pathsize + 1);
if (pathbuf == NULL) {
ret.errno = ENOMEM;
return ret;
}
strcpy(pathbuf, path); // TODO u_strcpy
ret.errno = dirfd_enter(pathbuf, dirfd, &dirfile, &dirnode);