Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-0 Rtti fix for failing tests - missing null check in recent update.

ghidra007f2af386845a2
diff --git a/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RTTIWindowsClassRecoverer.java b/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RTTIWindowsClassRecoverer.java
index f8ae30e3cb..31e5776379 100644
--- a/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RTTIWindowsClassRecoverer.java
+++ b/Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RTTIWindowsClassRecoverer.java
@@ -1569,6 +1569,12 @@ public class RTTIWindowsClassRecoverer extends RTTIClassRecoverer {
// it needs offset values and most are either large negatives (FFFFF....) or small offsets
// both of which are not valid addresses in a normal PE binary
Address referencedAddress = extendedFlatAPI.getPointer(address);
+
+ // if null then not an address so possibly valid
+ if (referencedAddress == null) {
+ return false;
+ }
+ // if is program memory location then invalid
if (program.getMemory().contains(referencedAddress)) {
return true;
}