From 0ba4ffffab25993362d3656757ceef9ba7c0117d Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Mon, 25 Sep 2023 20:21:12 +0300 Subject: [PATCH] [SystemSaveData] Return error when path is unsafe --- src/core/fs/archive_system_save_data.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/fs/archive_system_save_data.cpp b/src/core/fs/archive_system_save_data.cpp index eb572d90..37afb431 100644 --- a/src/core/fs/archive_system_save_data.cpp +++ b/src/core/fs/archive_system_save_data.cpp @@ -145,7 +145,8 @@ HorizonResult SystemSaveDataArchive::deleteFile(const FSPath& path) { Rust::Result SystemSaveDataArchive::openDirectory(const FSPath& path) { if (path.type == PathType::UTF16) { if (!isPathSafe(path)) { - Helpers::panic("Unsafe path in SystemSaveData::OpenDirectory"); + Helpers::warn("Unsafe path in SystemSaveData::OpenDirectory"); + return Err(Result::FS::FileNotFoundAlt); } fs::path p = IOFile::getAppData() / ".." / "SharedFiles" / "SystemSaveData";