From e9b8269ec551c91b875144e4ad47076c6b0a6dd9 Mon Sep 17 00:00:00 2001 From: pancake Date: Mon, 16 Feb 2015 19:10:00 +0100 Subject: [PATCH] Fix #2102 - Fix crash in `pDj 0` --- libr/core/disasm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libr/core/disasm.c b/libr/core/disasm.c index 2553ee761d..376f5288b1 100644 --- a/libr/core/disasm.c +++ b/libr/core/disasm.c @@ -2446,6 +2446,9 @@ R_API int r_core_print_disasm_json(RCore *core, ut64 addr, ut8 *buf, int nb_byte r_core_read_at (core, at, buf, nb_bytes); i=0; } + if (i>=nb_bytes) { + break; + } ret = r_asm_disassemble (core->assembler, &asmop, buf+i, nb_bytes-i); if (ret<1) { r_cons_printf (j>0? ",{": "{");