fix: Potential use-after-free with the .NET SDK
This commit is contained in:
parent
d011f37658
commit
83e26522b6
@ -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;
|
||||
};
|
||||
|
||||
}
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user