1
0
mirror of synced 2024-11-12 02:00:52 +01:00

fix: Potential use-after-free with the .NET SDK

This commit is contained in:
WerWolv 2023-09-08 22:00:15 +02:00
parent d011f37658
commit 83e26522b6
2 changed files with 3 additions and 2 deletions

View File

@ -18,6 +18,7 @@ namespace hex::script::loader {
private:
std::function<bool(const std::fs::path&)> m_loadAssembly;
std::fs::path::string_type m_assemblyLoaderPathString;
};
}

View File

@ -150,11 +150,11 @@ namespace hex::script::loader {
auto dotnetType = STRING("ImHex.EntryPoint, AssemblyLoader");
const char_t *dotnetTypeMethod = STRING("ExecuteScript");
const auto &assemblyPathStr = assemblyLoader.native();
this-> m_assemblyLoaderPathString = assemblyLoader.native();
component_entry_point_fn entryPoint = nullptr;
u32 result = loadAssembly(
assemblyPathStr.c_str(),
this->m_assemblyLoaderPathString.c_str(),
dotnetType,
dotnetTypeMethod,
nullptr,