syscalls/shutdown: add argument validity check

This commit is contained in:
Matheus
2026-04-01 17:03:30 -03:00
parent b74357f39b
commit e34e9e4881
+6 -1
View File
@@ -13,8 +13,13 @@ syscallret_t syscall_shutdown(context_t *, int fd, int how) {
.ret = -1
};
if (how > 2) {
ret.errno = EINVAL;
return ret;
}
++how; // convert to internal meaning
file_t *file = fd_get(fd);
if (file == NULL) {
ret.errno = EBADF;