Bläddra i källkod

VFS: Add two assertions to resolve_path() to catch corrupted file systems.

Andreas Kling 6 år sedan
förälder
incheckning
0d23cd73e6
1 ändrade filer med 2 tillägg och 0 borttagningar
  1. 2 0
      Kernel/VirtualFileSystem.cpp

+ 2 - 0
Kernel/VirtualFileSystem.cpp

@@ -477,9 +477,11 @@ InodeIdentifier VFS::resolve_path(const String& path, InodeIdentifier base, int&
 #endif
             auto mount = find_mount_for_guest(crumb_id);
             auto dir_inode = get_inode(mount->host());
+            ASSERT(dir_inode);
             crumb_id = dir_inode->lookup("..");
         }
         crumb_inode = get_inode(crumb_id);
+        ASSERT(crumb_inode);
         metadata = crumb_inode->metadata();
         if (metadata.is_directory()) {
             if (i != parts.size() - 1) {