mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
GP-5526 Correct CreateThunkCmd NPE
This commit is contained in:
parent
136a28d603
commit
cae8caac14
1 changed files with 6 additions and 5 deletions
|
@ -563,14 +563,15 @@ public class CreateThunkFunctionCmd extends BackgroundCommand<Program> {
|
||||||
Listing listing = program.getListing();
|
Listing listing = program.getListing();
|
||||||
|
|
||||||
Instruction instr = listing.getInstructionAt(entry);
|
Instruction instr = listing.getInstructionAt(entry);
|
||||||
if (instr == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
// if there is no pcode, go to the next instruction
|
// if there is no pcode, go to the next instruction
|
||||||
// assume fallthrough (ie. x86 instruction ENDBR64)
|
// assume fallthrough (ie. x86 instruction ENDBR64)
|
||||||
// TODO: at some point, might need to do a NOP detection
|
// TODO: at some point, might need to do a NOP detection
|
||||||
if (instr.getPcode().length == 0) {
|
while (instr != null && instr.getPcode().length == 0) {
|
||||||
instr = listing.getInstructionAfter(entry);
|
instr = listing.getInstructionAfter(instr.getAddress());
|
||||||
|
}
|
||||||
|
if (instr == null) {
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
FlowType flowType;
|
FlowType flowType;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue