Skip to content

Ghidra is a software reverse engineering (SRE) framework

Merge remote-tracking branch 'origin/patch'

Ryan Kurtz580463dd2edd
diff --cc Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/AbstractLibrarySupportLoader.java
index 29064b351e,e984af28d9..491f10529d
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/AbstractLibrarySupportLoader.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/AbstractLibrarySupportLoader.java
@@@ -1110,17 -1058,21 +1109,22 @@@ public abstract class AbstractLibrarySu
List<FileSystemSearchPath> result = new ArrayList<>();
FileSystemService fsService = FileSystemService.getInstance();
if (isLoadSystemLibraries(options) || shouldSearchAllPaths(options)) {
- List<Path> searchPaths = LibrarySearchPathManager.getLibraryPathsList()
- .stream()
- .map(s -> Path.of(s).normalize())
- .filter(Path::isAbsolute)
- .filter(Files::exists)
- .toList();
-
+ List<Path> searchPaths = new ArrayList<>();
+ for (String str : LibrarySearchPathManager.getLibraryPathsList()) {
+ try {
+ Path path = Path.of(str).normalize();
+ if (path.isAbsolute() && Files.exists(path)) {
+ searchPaths.add(path);
+ }
+ }
+ catch (InvalidPathException e) {
+ log.appendMsg("Skipping invalid system library search path: \"" + str + "\"");
+ }
+ }
for (Path searchPath : searchPaths) {
try {
- FSRL searchFSRL = fsService.getLocalFSRL(searchPath.toFile());
+ FSRL searchFSRL =
+ fsService.getLocalFSRL(searchPath.toFile().getCanonicalFile());
FileSystemRef fsRef =
fsService.probeFileForFilesystem(searchFSRL, monitor, null);
if (fsRef != null) {