mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 15:08:21 +00:00
open: fix possible use of unitialized variable
This commit is contained in:
@@ -20,6 +20,9 @@ syscallret_t syscall_openat(context_t *context, int dirfd, char *path, int flags
|
|||||||
|
|
||||||
size_t pathsize;
|
size_t pathsize;
|
||||||
ret.errno = usercopy_strlen(path, &pathsize);
|
ret.errno = usercopy_strlen(path, &pathsize);
|
||||||
|
if (ret.errno)
|
||||||
|
return ret;
|
||||||
|
|
||||||
char *pathbuf = alloc(pathsize + 1);
|
char *pathbuf = alloc(pathsize + 1);
|
||||||
if (pathbuf == NULL) {
|
if (pathbuf == NULL) {
|
||||||
ret.errno = ENOMEM;
|
ret.errno = ENOMEM;
|
||||||
|
|||||||
Reference in New Issue
Block a user