summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/FileSystem/VirtualFileSystem.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Kernel/FileSystem/VirtualFileSystem.cpp b/Kernel/FileSystem/VirtualFileSystem.cpp
index f06203c2a9..646af014fe 100644
--- a/Kernel/FileSystem/VirtualFileSystem.cpp
+++ b/Kernel/FileSystem/VirtualFileSystem.cpp
@@ -498,6 +498,10 @@ KResult VFS::rename(StringView old_path, StringView new_path, Custody& base)
return new_custody_or_error.error();
}
+ if (!old_parent_custody || !new_parent_custody) {
+ return EPERM;
+ }
+
auto& old_parent_inode = old_parent_custody->inode();
auto& new_parent_inode = new_parent_custody->inode();