From 726c023f9e2297c35614e595b221e97b2e5ec6a7 Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Wed, 29 Dec 2021 20:13:29 +0100 Subject: [PATCH] Kernel: Propagate allocation failure in resolve_path_without_veil --- Kernel/FileSystem/VirtualFileSystem.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Kernel/FileSystem/VirtualFileSystem.cpp b/Kernel/FileSystem/VirtualFileSystem.cpp index ebc94a3ac5..3855182999 100644 --- a/Kernel/FileSystem/VirtualFileSystem.cpp +++ b/Kernel/FileSystem/VirtualFileSystem.cpp @@ -931,10 +931,10 @@ ErrorOr> VirtualFileSystem::resolve_path_without_veil(Str // We prepend a "." to it to ensure that it's not empty and that // any initial slashes it might have get interpreted properly. StringBuilder remaining_path; - remaining_path.append('.'); - remaining_path.append(path.substring_view_starting_after_substring(part)); + TRY(remaining_path.try_append('.')); + TRY(remaining_path.try_append(path.substring_view_starting_after_substring(part))); - return resolve_path_without_veil(remaining_path.to_string(), symlink_target, out_parent, options, symlink_recursion_level + 1); + return resolve_path_without_veil(remaining_path.string_view(), symlink_target, out_parent, options, symlink_recursion_level + 1); } }