Skip to content

Commit

Permalink
Fix #10294 - crash in r2_hoobr__6502_op
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Jun 11, 2018
1 parent bceeb37 commit bbb4af5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions libr/anal/p/anal_6502.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,9 +682,15 @@ static int _6502_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int le
op->cycles = 2;
op->failcycles = 3;
op->type = R_ANAL_OP_TYPE_CJMP;
if (data[1] <= 127)
op->jump = addr + data[1] + op->size;
else op->jump = addr - (256 - data[1]) + op->size;
if (len > 1) {
if (data[1] <= 127) {
op->jump = addr + data[1] + op->size;
} else {
op->jump = addr - (256 - data[1]) + op->size;
}
} else {
op->jump = addr;
}
op->fail = addr + op->size;
// FIXME: add a type of conditional
// op->cond = R_ANAL_COND_LE;
Expand Down

0 comments on commit bbb4af5

Please sign in to comment.