mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 23:18:21 +00:00
open: fix no out of memory check
This commit is contained in:
@@ -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
|
size_t pathsize = strlen(path); // TODO u_strlen
|
||||||
char *pathbuf = alloc(pathsize + 1);
|
char *pathbuf = alloc(pathsize + 1);
|
||||||
|
if (pathbuf == NULL) {
|
||||||
|
ret.errno = ENOMEM;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
strcpy(pathbuf, path); // TODO u_strcpy
|
strcpy(pathbuf, path); // TODO u_strcpy
|
||||||
|
|
||||||
ret.errno = dirfd_enter(pathbuf, dirfd, &dirfile, &dirnode);
|
ret.errno = dirfd_enter(pathbuf, dirfd, &dirfile, &dirnode);
|
||||||
|
|||||||
Reference in New Issue
Block a user