mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:18:11 +00:00
VFS: Add two assertions to resolve_path() to catch corrupted file systems.
This commit is contained in:
parent
18210c606d
commit
0d23cd73e6
1 changed files with 2 additions and 0 deletions
|
@ -477,9 +477,11 @@ InodeIdentifier VFS::resolve_path(const String& path, InodeIdentifier base, int&
|
||||||
#endif
|
#endif
|
||||||
auto mount = find_mount_for_guest(crumb_id);
|
auto mount = find_mount_for_guest(crumb_id);
|
||||||
auto dir_inode = get_inode(mount->host());
|
auto dir_inode = get_inode(mount->host());
|
||||||
|
ASSERT(dir_inode);
|
||||||
crumb_id = dir_inode->lookup("..");
|
crumb_id = dir_inode->lookup("..");
|
||||||
}
|
}
|
||||||
crumb_inode = get_inode(crumb_id);
|
crumb_inode = get_inode(crumb_id);
|
||||||
|
ASSERT(crumb_inode);
|
||||||
metadata = crumb_inode->metadata();
|
metadata = crumb_inode->metadata();
|
||||||
if (metadata.is_directory()) {
|
if (metadata.is_directory()) {
|
||||||
if (i != parts.size() - 1) {
|
if (i != parts.size() - 1) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue