Skip to content

Commit

Permalink
Fix radareorg#295 - SIGSEGV in /r $number
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Oct 26, 2013
1 parent 01ac786 commit 1953960
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions libr/core/anal.c
Original file line number Diff line number Diff line change
Expand Up @@ -869,13 +869,17 @@ static int r_core_anal_followptr(RCore *core, ut64 at, ut64 ptr, ut64 ref, int c
int wordsize, endian;

if (ptr == ref) {
if (code) r_cons_printf ("ar 0x%08"PFMT64x" 0x%08"PFMT64x"\n", (ut64)ref, (ut64)at);
else r_cons_printf ("ard 0x%08"PFMT64x" 0x%08"PFMT64x"\n", (ut64)ref, (ut64)at);
if (code) r_cons_printf ("ar 0x%08"PFMT64x" 0x%08"PFMT64x"\n",
(ut64)ref, (ut64)at);
else r_cons_printf ("ard 0x%08"PFMT64x" 0x%08"PFMT64x"\n",
(ut64)ref, (ut64)at);
return R_TRUE;
}
if (depth < 1)
return R_FALSE;
endian = (core->bin->cur.o->info->big_endian)? !LIL_ENDIAN: LIL_ENDIAN;
if (core->bin && core->bin->cur.o && core->bin->cur.o->info) {
endian = core->bin->cur.o->info->big_endian;
} else endian = CPU_ENDIAN;
wordsize = (int)(core->anal->bits/8);
if ((dataptr = r_io_read_i (core->io, ptr, wordsize, endian)) == -1)
return R_FALSE;
Expand Down

0 comments on commit 1953960

Please sign in to comment.