mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:27:35 +00:00
Kernel: open() with a zero-length path should fail with EINVAL
This commit is contained in:
parent
0e80b7faa5
commit
11fd7aed2a
1 changed files with 2 additions and 0 deletions
|
@ -1348,6 +1348,8 @@ int Process::sys$open(const Syscall::SC_open_params* params)
|
||||||
if (!validate_read_typed(params))
|
if (!validate_read_typed(params))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
auto& [path, path_length, options, mode] = *params;
|
auto& [path, path_length, options, mode] = *params;
|
||||||
|
if (!path_length)
|
||||||
|
return -EINVAL;
|
||||||
if (!validate_read(path, path_length))
|
if (!validate_read(path, path_length))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
#ifdef DEBUG_IO
|
#ifdef DEBUG_IO
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue