Skip to content

Commit ae7432b

Browse files
committed
Merge remote-tracking branch 'origin/patch'
2 parents 64edf25 + fe841ab commit ae7432b

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/macho/commands/SymbolTableCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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);

Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/MachoProgramBuilder.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)