Fix crash in aoe

This commit is contained in:
pancake 2016-06-06 10:16:26 +02:00
parent 68a7fb5ebd
commit 12d8fbca15

View File

@ -368,12 +368,12 @@ static void core_anal_bytes(RCore *core, const ut8 *buf, int len, int nops, int
} }
for (i = idx = ret = 0; idx < len && (!nops || (nops && i < nops)); i++, idx += ret) { for (i = idx = ret = 0; idx < len && (!nops || (nops && i < nops)); i++, idx += ret) {
addr = core->offset + idx; addr = core->offset + idx;
esilstr = R_STRBUF_SAFEGET (&op.esil);
// TODO: use more anal hints // TODO: use more anal hints
hint = r_anal_hint_get (core->anal, addr); hint = r_anal_hint_get (core->anal, addr);
r_asm_set_pc (core->assembler, addr); r_asm_set_pc (core->assembler, addr);
ret = r_asm_disassemble (core->assembler, &asmop, buf + idx, len - idx); ret = r_asm_disassemble (core->assembler, &asmop, buf + idx, len - idx);
ret = r_anal_op (core->anal, &op, core->offset + idx, buf + idx, len - idx); ret = r_anal_op (core->anal, &op, core->offset + idx, buf + idx, len - idx);
esilstr = R_STRBUF_SAFEGET (&op.esil);
if (ret < 1 && fmt != 'd') { if (ret < 1 && fmt != 'd') {
eprintf ("Oops at 0x%08" PFMT64x " (", core->offset + idx); eprintf ("Oops at 0x%08" PFMT64x " (", core->offset + idx);
for (i = idx, j = 0; i < core->blocksize && j < 3; ++i, ++j) { for (i = idx, j = 0; i < core->blocksize && j < 3; ++i, ++j) {