mirror of
https://github.com/radareorg/radare2.git
synced 2025-01-27 08:12:44 +00:00
Trimming down the disasm to fix an oobread in VV
$ r2 -NAAc 'e asm.pseudo=1;s 0x000c7dd0;VV' classes.dex > /dev/null
This commit is contained in:
parent
7323e6ac11
commit
1dfbedc545
@ -933,13 +933,9 @@ static char *colorize_asm_string(RCore *core, RDisasmState *ds, bool print_color
|
||||
if (!scol2) {
|
||||
scol2 = strdup ("");
|
||||
}
|
||||
|
||||
source = malloc (strlen (scol1) + strlen (scol2) + 2 + 1); // reuse source variable
|
||||
if (source) {
|
||||
sprintf (source, "%s||%s", scol1, scol2);
|
||||
free (scol1);
|
||||
free (scol2);
|
||||
}
|
||||
source = r_str_newf ("%s||%s", scol1, scol2);
|
||||
free (scol1);
|
||||
free (scol2);
|
||||
return source;
|
||||
}
|
||||
return r_print_colorize_opcode (ds->core->print, source, ds->color_reg, ds->color_num, partial_reset, f ? f->addr : 0);
|
||||
|
@ -1997,6 +1997,7 @@ R_API char* r_print_colorize_opcode(RPrint *print, char *p, const char *reg, con
|
||||
if (is_jmp) {
|
||||
return strdup (p);
|
||||
}
|
||||
r_str_trim_head_tail (p);
|
||||
if (opcode_sz > COLORIZE_BUFSIZE) {
|
||||
/* return same string in case of error */
|
||||
return strdup (p);
|
||||
|
Loading…
x
Reference in New Issue
Block a user