Kernel: Don't allow opening file with path ""

This commit is contained in:
Bananymous 2025-04-18 02:37:16 +03:00
parent 994713d04c
commit 4cdf218145
1 changed files with 3 additions and 0 deletions

View File

@ -445,6 +445,9 @@ namespace Kernel
{ {
ASSERT(m_process_lock.is_locked()); ASSERT(m_process_lock.is_locked());
if (path[0] == '\0')
return BAN::Error::from_errno(ENOENT);
auto relative_parent = TRY(find_relative_parent(fd, path)); auto relative_parent = TRY(find_relative_parent(fd, path));
VirtualFileSystem::File parent; VirtualFileSystem::File parent;