From f48c89b6e6b068f9e124d462c0e107e00872b54c Mon Sep 17 00:00:00 2001 From: Peiwei Hu Date: Wed, 3 Jan 2024 12:11:22 +0800 Subject: [PATCH] fixup! Use internal API instead of command --- librz/core/cprint.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/librz/core/cprint.c b/librz/core/cprint.c index 1a351a9144f..7193e079f7e 100644 --- a/librz/core/cprint.c +++ b/librz/core/cprint.c @@ -548,6 +548,7 @@ static void core_handle_call(RzCore *core, char *line, char **str) { static char *cons_disassembly(RzCore *core, ut64 addr, ut32 byte_len, ut32 inst_len) { rz_return_val_if_fail(core && (byte_len || inst_len), NULL); + // cbytes in disasm_options decides whether byte_len constrains inst_len bool cbytes = true; if (byte_len == 0) { @@ -555,6 +556,10 @@ static char *cons_disassembly(RzCore *core, ut64 addr, ut32 byte_len, ut32 inst_ byte_len = inst_len; } + if (inst_len == 0) { + inst_len = byte_len; + } + ut8 *block = malloc(byte_len + 1); if (!block) { RZ_LOG_ERROR("Cannot allocate buffer\n");