Kernel: open() with a zero-length path should fail with EINVAL

This commit is contained in:
Andreas Kling 2019-11-11 09:38:44 +01:00
parent 0e80b7faa5
commit 11fd7aed2a
Notes: sideshowbarker 2024-07-19 11:16:23 +09:00

View file

@ -1348,6 +1348,8 @@ int Process::sys$open(const Syscall::SC_open_params* params)
if (!validate_read_typed(params))
return -EFAULT;
auto& [path, path_length, options, mode] = *params;
if (!path_length)
return -EINVAL;
if (!validate_read(path, path_length))
return -EFAULT;
#ifdef DEBUG_IO