Fix calloc(-1) when no arch plugin selected in disasm

This commit is contained in:
pancake 2023-09-12 21:21:29 +02:00 committed by pancake
parent c1d426fb37
commit c0d98f3ec4
2 changed files with 6 additions and 2 deletions

View File

@ -3633,6 +3633,10 @@ static void ds_print_bytes(RDisasmState *ds) {
#if 0
str = r_asm_op_get_hex (&ds->asmop);
#else
if (ds->oplen < 1) {
int minopsz = r_anal_archinfo (core->anal, R_ANAL_ARCHINFO_MIN_OP_SIZE);
ds->oplen = minopsz;
}
if (ds->analop.bytes && ds->analop.size > ds->oplen) {
str = r_hex_bin2strdup (ds->analop.bytes, ds->oplen);
} else {
@ -3642,7 +3646,7 @@ static void ds_print_bytes(RDisasmState *ds) {
str = r_hex_bin2strdup (bytes, ds->oplen);
free (bytes);
} else {
str = strdup ("");
str = strdup ("??");
}
}
#endif

View File

@ -296,7 +296,7 @@ R_API bool r_core_hack(RCore *core, const char *op) {
if (core->blocksize < 4) {
return false;
}
#if R2_580
#if R2_600
// R2_590 TODO: call RArch.patch() if available, otherwise just do this hack until all anal plugs are moved to arch
// r_arch_patch (aop, 0);
RArchSession *acur = R_UNWRAP3 (core, rasm, acur);