Ghidra is a software reverse engineering (SRE) framework
GP-1902 Fix NPE in DwarfEncodingModeDataType when bad data
dev747368b86703c35dd0
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/exceptionhandlers/gcc/DwarfDecoderFactory.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/exceptionhandlers/gcc/DwarfDecoderFactory.javaindex b16abf9c63..7f225d0776 100644--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/exceptionhandlers/gcc/DwarfDecoderFactory.java+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/exceptionhandlers/gcc/DwarfDecoderFactory.java@@ -15,6 +15,7 @@*/package ghidra.app.plugin.exceptionhandlers.gcc;+import java.util.Objects;import java.util.concurrent.ConcurrentHashMap;import ghidra.app.plugin.exceptionhandlers.gcc.datatype.SignedLeb128DataType;@@ -71,7 +72,7 @@ public class DwarfDecoderFactory {private static DwarfEHDecoder createDecoder(DwarfEHDataDecodeFormat style,DwarfEHDataApplicationMode mod, boolean isIndirect) {- switch (style) {+ switch (Objects.requireNonNullElse(style, DwarfEHDataDecodeFormat.DW_EH_PE_omit)) {case DW_EH_PE_absptr:return new DW_EH_PE_absptr_Decoder(mod, isIndirect);case DW_EH_PE_uleb128:diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/exceptionhandlers/gcc/DwarfEHDataDecodeFormat.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/exceptionhandlers/gcc/DwarfEHDataDecodeFormat.javaindex 0ac545b26e..228ba80e09 100644--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/exceptionhandlers/gcc/DwarfEHDataDecodeFormat.java+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/exceptionhandlers/gcc/DwarfEHDataDecodeFormat.java@@ -1,6 +1,5 @@/* ###* IP: GHIDRA- * REVIEWED: YES** Licensed under the Apache License, Version 2.0 (the "License");* you may not use this file except in compliance with the License.@@ -18,7 +17,7 @@ package ghidra.app.plugin.exceptionhandlers.gcc;/*** Exception handling data decoding formats.- * See the <a href="http://refspecs.freestandards.org/LSB_3.0.0/LSB-Core-generic/LSB-Core-generic/dwarfext.html">Linux Standard Base DWARF extensions specification</a> for details.+ * See the <a href="https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/dwarfext.html">Linux Standard Base DWARF extensions specification</a> for details.*/public enum DwarfEHDataDecodeFormat {// @formatter:off