From d2bd9406a245d40fa30be79da0c42a91bddafc4e Mon Sep 17 00:00:00 2001 From: "Azamat H. Hackimov" Date: Tue, 12 Nov 2024 06:49:21 +0300 Subject: [PATCH] Use blocksize to determine size for rz_cmd_disassembly_n_bytes_handler() (#4714) --- librz/core/cmd/cmd_print.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/librz/core/cmd/cmd_print.c b/librz/core/cmd/cmd_print.c index 4d98685a6b1..139f9d3b2c6 100644 --- a/librz/core/cmd/cmd_print.c +++ b/librz/core/cmd/cmd_print.c @@ -3262,11 +3262,7 @@ static bool core_disassembly(RzCore *core, int n_bytes, int n_instrs, RzCmdState } RZ_IPI RzCmdStatus rz_cmd_disassembly_n_bytes_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state) { - if (argc <= 1) { - RZ_LOG_ERROR("Invalid number of arguments\n"); - return RZ_CMD_STATUS_ERROR; - } - int n_bytes = (int)rz_num_math(core->num, argv[1]); + ut64 n_bytes = argc > 1 ? (ut64)rz_num_math(core->num, argv[1]) : core->blocksize; if (n_bytes == 0) { RZ_LOG_ERROR("The argument cannot be zero\n"); return RZ_CMD_STATUS_ERROR;