Skip to content

Commit

Permalink
fix: Potential crash on Linux when loading external libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
WerWolv committed Mar 15, 2024
1 parent a143765 commit 373db3d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/libimhex/include/hex/api/plugin_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ namespace hex {
static bool load(const std::fs::path &pluginFolder);

static bool loadLibraries();
static bool loadLibraries(const std::fs::path &pluginFolder);
static bool loadLibraries(const std::fs::path &libraryFolder);

static void unload();
static void reload();
Expand Down
4 changes: 2 additions & 2 deletions lib/libimhex/source/api/plugin_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,9 @@ namespace hex {
return success;
}

bool PluginManager::loadLibraries(const std::fs::path& pluginFolder) {
bool PluginManager::loadLibraries(const std::fs::path& libraryFolder) {
bool success = true;
for (const auto &entry : std::fs::recursive_directory_iterator(pluginFolder)) {
for (const auto &entry : std::fs::directory_iterator(libraryFolder)) {
if (!(entry.path().extension() == ".dll" || entry.path().extension() == ".so" || entry.path().extension() == ".dylib"))
continue;

Expand Down

0 comments on commit 373db3d

Please sign in to comment.