Ghidra is a software reverse engineering (SRE) framework
GP-4106 fix golang error when binary isn't golang or unsupported ver
dev74736830dbddd0fd9b
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/TransientProgramProperties.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/TransientProgramProperties.javaindex 6a666432fc..f2f7201873 100644--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/TransientProgramProperties.java+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/TransientProgramProperties.java@@ -107,8 +107,7 @@ public class TransientProgramProperties {if (supplierVal == null) {return null;}- property = new Property(key, supplierVal, scope);- perProgramProps.addProperty(key, supplierVal, scope);+ property = perProgramProps.addProperty(key, supplierVal, scope);}if (property.scope != scope) {throw new IllegalArgumentException("Mismatched Program property scope");@@ -178,14 +177,16 @@ public class TransientProgramProperties {}}- private void addProperty(Object key, Object value, SCOPE scope) {+ private Property addProperty(Object key, Object value, SCOPE scope) {if (scope == SCOPE.ANALYSIS_SESSION) {if (!aamListenerAdded) {AutoAnalysisManager.getAnalysisManager(program).addListener(this);aamListenerAdded = true;}}- props.put(key, new Property(key, value, scope));+ Property newProperty = new Property(key, value, scope);+ props.put(key, newProperty);+ return newProperty;}}diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/golang/rtti/GoRttiMapper.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/golang/rtti/GoRttiMapper.javaindex e08c1138f3..c835584f31 100644--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/golang/rtti/GoRttiMapper.java+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/golang/rtti/GoRttiMapper.java@@ -110,7 +110,9 @@ public class GoRttiMapper extends DataTypeMapper {Msg.info(GoRttiMapper.class, "Reading golang binary info: " + program.getName());try {GoRttiMapper supplier_result = getGoBinary(program);- supplier_result.init(monitor);+ if (supplier_result != null) {+ supplier_result.init(monitor);+ }return supplier_result;}catch (IllegalArgumentException | IOException e) {