File tree Expand file tree Collapse file tree
Ghidra/Features/Base/src/main/java/ghidra/app/util
bin/format/macho/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ public class SymbolTableCommand extends LoadCommand {
4242 private long stroff ;
4343 private long strsize ;
4444
45- private List <NList > symbols = new ArrayList <NList >();
45+ private List <NList > symbols = new ArrayList <>();
4646
4747 /**
4848 * Creates and parses a new {@link SymbolTableCommand}
@@ -144,7 +144,7 @@ public NList getSymbolAt(int index) {
144144 (index & DynamicSymbolTableConstants .INDIRECT_SYMBOL_ABS ) != 0 ) {
145145 return null ;
146146 }
147- if (index > symbols .size ()) {
147+ if (index >= symbols .size ()) {
148148 return null ;
149149 }
150150 return symbols .get (index );
Original file line number Diff line number Diff line change @@ -684,7 +684,8 @@ protected void processStubs() throws Exception {
684684 for (int i = indirectSymbolTableIndex ; i < indirectSymbolTableIndex + nSymbols ; ++i ) {
685685 monitor .increment ();
686686 int symbolIndex = indirectSymbols .get (i );
687- NList symbol = symbolTableCommand .getSymbolAt (symbolIndex );
687+ NList symbol =
688+ symbolTableCommand != null ? symbolTableCommand .getSymbolAt (symbolIndex ) : null ;
688689 String name = null ;
689690 if (symbol != null && !symbol .getString ().isBlank ()) {
690691 name = SymbolUtilities .replaceInvalidChars (symbol .getString (), true );
You can’t perform that action at this time.
0 commit comments