mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-10-19 18:12:14 -09:00
GP-3445: Fixed an IllegalStateException that could occur if both "Load
Local Libraries From Disk" and "Load System Libraries From Disk" options are used during import, and the same library is found in both local and system directories
This commit is contained in:
@@ -507,6 +507,7 @@ public abstract class AbstractLibrarySupportLoader extends AbstractProgramLoader
|
||||
// options turned off (if shouldSearchAllPaths() is overridden to return true).
|
||||
// In this case, we still want to process those libraries, but we
|
||||
// do not want to save them, so they can be released.
|
||||
boolean loadedLocal = false;
|
||||
if (!localSearchPaths.isEmpty()) {
|
||||
Loaded<Program> loadedLibrary = loadLibraryFromSearchPaths(
|
||||
libraryName, provider, localSearchPaths, libraryDestFolderPath,
|
||||
@@ -514,13 +515,14 @@ public abstract class AbstractLibrarySupportLoader extends AbstractProgramLoader
|
||||
if (loadedLibrary != null) {
|
||||
if (loadLocalLibraries) {
|
||||
loadedPrograms.add(loadedLibrary);
|
||||
loadedLocal = true;
|
||||
}
|
||||
else {
|
||||
loadedLibrary.release(consumer);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!systemSearchPaths.isEmpty()) {
|
||||
if (!loadedLocal && !systemSearchPaths.isEmpty()) {
|
||||
Loaded<Program> loadedLibrary = loadLibraryFromSearchPaths(
|
||||
libraryName, provider, systemSearchPaths, libraryDestFolderPath,
|
||||
unprocessed, depth, desiredLoadSpec, options, log, consumer, monitor);
|
||||
|
||||
Reference in New Issue
Block a user