GP-1902 Fix NPE in DwarfEncodingModeDataType when bad data

This commit is contained in:
dev747368 2022-04-08 18:21:27 +00:00
parent 36f7352c78
commit b86703c35d
2 changed files with 3 additions and 3 deletions

View file

@ -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:

View file

@ -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