From 2428fcc3e1357c951bf70aada8179041e0a1edf7 Mon Sep 17 00:00:00 2001 From: Christian Nieves Date: Wed, 4 Dec 2024 19:30:55 -0600 Subject: [PATCH 1/2] Fix potential IndexOutOfBoundsException in PDB parsing --- .../app/util/bin/format/pdb2/pdbreader/SymbolRecords.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/app/util/bin/format/pdb2/pdbreader/SymbolRecords.java b/Ghidra/Features/PDB/src/main/java/ghidra/app/util/bin/format/pdb2/pdbreader/SymbolRecords.java index 6a54442654..a1609f5429 100644 --- a/Ghidra/Features/PDB/src/main/java/ghidra/app/util/bin/format/pdb2/pdbreader/SymbolRecords.java +++ b/Ghidra/Features/PDB/src/main/java/ghidra/app/util/bin/format/pdb2/pdbreader/SymbolRecords.java @@ -135,6 +135,9 @@ public class SymbolRecords { if (debugInfo == null) { return; } + if (debugInfo.getModuleInformationList().size() == 0) { + return; + } // We are assuming that first in the list is the one to look at for cases 1 and 2. // If something else like lowest stream number, then need to change the logic. ModuleInformation moduleInfo = debugInfo.getModuleInformationList().get(0); From 90afe08e9c88de41aade215d021c5e726765b94b Mon Sep 17 00:00:00 2001 From: Ryan Kurtz Date: Thu, 5 Dec 2024 08:53:36 -0500 Subject: [PATCH 2/2] GP-0: Certify and tweak --- .../app/util/bin/format/pdb2/pdbreader/SymbolRecords.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/app/util/bin/format/pdb2/pdbreader/SymbolRecords.java b/Ghidra/Features/PDB/src/main/java/ghidra/app/util/bin/format/pdb2/pdbreader/SymbolRecords.java index a1609f5429..29a33431ef 100644 --- a/Ghidra/Features/PDB/src/main/java/ghidra/app/util/bin/format/pdb2/pdbreader/SymbolRecords.java +++ b/Ghidra/Features/PDB/src/main/java/ghidra/app/util/bin/format/pdb2/pdbreader/SymbolRecords.java @@ -135,7 +135,7 @@ public class SymbolRecords { if (debugInfo == null) { return; } - if (debugInfo.getModuleInformationList().size() == 0) { + if (debugInfo.getModuleInformationList().isEmpty()) { return; } // We are assuming that first in the list is the one to look at for cases 1 and 2.