Kernel: Fix string validation in unlink syscall

This commit is contained in:
Bananymous 2025-08-27 22:57:22 +03:00
parent a8bb07052e
commit c1b6b6b76a
1 changed files with 2 additions and 1 deletions

View File

@ -1236,7 +1236,8 @@ namespace Kernel
{
LockGuard _(m_process_lock);
TRY(validate_string_access(path1));
TRY(validate_string_access(path2));
if (path2 != nullptr)
TRY(validate_string_access(path2));
if (!find_file(fd, path2, O_NOFOLLOW).is_error())
return BAN::Error::from_errno(EEXIST);