mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
VFS: Add two assertions to resolve_path() to catch corrupted file systems.
This commit is contained in:
parent
18210c606d
commit
0d23cd73e6
Notes:
sideshowbarker
2024-07-19 15:42:43 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/0d23cd73e68
1 changed files with 2 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue