mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 14:58:46 +00:00
Kernel: Use OOM-safe absolute path serialization in InodeFile::mmap()
Switch from OpenFileDescription::absolute_path() to the OOM-safe try_serialize_absolute_path() (and propagate any errors to the caller.)
This commit is contained in:
parent
1a28fc3cb5
commit
ec4b814c9a
Notes:
sideshowbarker
2024-07-18 04:29:45 +09:00
Author: https://github.com/awesomekling
Commit: ec4b814c9a
1 changed files with 2 additions and 1 deletions
|
@ -89,7 +89,8 @@ KResultOr<Memory::Region*> InodeFile::mmap(Process& process, OpenFileDescription
|
|||
vmobject = TRY(Memory::SharedInodeVMObject::try_create_with_inode(inode()));
|
||||
else
|
||||
vmobject = TRY(Memory::PrivateInodeVMObject::try_create_with_inode(inode()));
|
||||
return process.address_space().allocate_region_with_vmobject(range, vmobject.release_nonnull(), offset, description.absolute_path(), prot, shared);
|
||||
auto path = TRY(description.try_serialize_absolute_path());
|
||||
return process.address_space().allocate_region_with_vmobject(range, vmobject.release_nonnull(), offset, path->view(), prot, shared);
|
||||
}
|
||||
|
||||
String InodeFile::absolute_path(const OpenFileDescription& description) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue