From 294a30e445ec9cd94d66efc8f94048606716ad35 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sun, 3 Nov 2024 19:27:08 +0100 Subject: [PATCH] Fix ScriptApiSecurity::checkPath mangling non-existent paths bug introduced in 1c1c97cbd1d7913ac12bf550ec02c97f843a0fd3 --- src/script/cpp_api/s_security.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/cpp_api/s_security.cpp b/src/script/cpp_api/s_security.cpp index 0d3209985..b23e94cd2 100644 --- a/src/script/cpp_api/s_security.cpp +++ b/src/script/cpp_api/s_security.cpp @@ -555,7 +555,7 @@ bool ScriptApiSecurity::checkPath(lua_State *L, const char *path, // by the operating system anyways. return false; } - removed.append(component).append(removed.empty() ? "" : DIR_DELIM + removed); + removed = component + (removed.empty() ? "" : DIR_DELIM + removed); abs_path = fs::AbsolutePath(cur_path); } if (abs_path.empty())