From 7c79e84808179ec3ccf0ba01a887ec14954dbfeb Mon Sep 17 00:00:00 2001 From: Youri Date: Wed, 4 Mar 2026 16:15:01 +0100 Subject: [PATCH 1/2] Change weakly_canonical to absolute In LibraryAdapter platform implementations --- Lila/src/Platform/Linux/LinuxLibraryAdapter.cpp | 2 +- Lila/src/Platform/Windows/WindowsLibraryAdapter.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Lila/src/Platform/Linux/LinuxLibraryAdapter.cpp b/Lila/src/Platform/Linux/LinuxLibraryAdapter.cpp index 7ddbb82..a68c081 100644 --- a/Lila/src/Platform/Linux/LinuxLibraryAdapter.cpp +++ b/Lila/src/Platform/Linux/LinuxLibraryAdapter.cpp @@ -15,7 +15,7 @@ namespace Lila::Platform { } void LibraryAdapter::loadLibrary(const std::filesystem::path& path) { - handle_m = dlopen(std::filesystem::weakly_canonical(path).string().c_str(), RTLD_LAZY | RTLD_LOCAL); + handle_m = dlopen(std::filesystem::absolute(path).string().c_str(), RTLD_LAZY | RTLD_LOCAL); if (!handle_m) LILA_FATAL("Failed to load library: {}!", path.string()); diff --git a/Lila/src/Platform/Windows/WindowsLibraryAdapter.cpp b/Lila/src/Platform/Windows/WindowsLibraryAdapter.cpp index a38b30d..3b06b9f 100644 --- a/Lila/src/Platform/Windows/WindowsLibraryAdapter.cpp +++ b/Lila/src/Platform/Windows/WindowsLibraryAdapter.cpp @@ -15,7 +15,7 @@ namespace Lila::Platform { } void LibraryAdapter::loadLibrary(const std::filesystem::path& path) { - handle_m = LoadLibrary(std::filesystem::weakly_canonical(path).string().c_str()); + handle_m = LoadLibrary(std::filesystem::absolute(path).string().c_str()); if (!handle_m) LILA_FATAL("Failed to load library: {}!", path.string()); From 99a3089d092d32b54bab68f7049dac29540c9797 Mon Sep 17 00:00:00 2001 From: Youri Date: Wed, 4 Mar 2026 16:16:39 +0100 Subject: [PATCH 2/2] Update WindowsLibraryAdapter.cpp I hate CWE-829 --- Lila/src/Platform/Windows/WindowsLibraryAdapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lila/src/Platform/Windows/WindowsLibraryAdapter.cpp b/Lila/src/Platform/Windows/WindowsLibraryAdapter.cpp index 3b06b9f..3f992c6 100644 --- a/Lila/src/Platform/Windows/WindowsLibraryAdapter.cpp +++ b/Lila/src/Platform/Windows/WindowsLibraryAdapter.cpp @@ -15,7 +15,7 @@ namespace Lila::Platform { } void LibraryAdapter::loadLibrary(const std::filesystem::path& path) { - handle_m = LoadLibrary(std::filesystem::absolute(path).string().c_str()); + handle_m = LoadLibraryEx(std::filesystem::absolute(path).string().c_str(), nullptr, LOAD_LIBRARY_SEARCH_APPLICATION_DIR | LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); if (!handle_m) LILA_FATAL("Failed to load library: {}!", path.string());