diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-11-11 09:38:44 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-11-11 13:13:08 +0100 |
commit | 11fd7aed2a5594405e14b2b58757c61460372b36 (patch) | |
tree | d8e0e5cae3131ed07514efd4c4685eca401c6d29 /Kernel | |
parent | 0e80b7faa585248f4e68c43c6964a9d162630c33 (diff) | |
download | serenity-11fd7aed2a5594405e14b2b58757c61460372b36.zip |
Kernel: open() with a zero-length path should fail with EINVAL
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Process.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 35e1b81995..54afa1eadd 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -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 |