mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-02 03:32:04 +00:00
Fix asan crash and r2r regression
This commit is contained in:
parent
8cf1adfb27
commit
ccfea838b9
@ -613,7 +613,7 @@ static bool database_load(R2RTestDatabase *db, const char *path, int depth) {
|
||||
char *sa = r_sys_getenv ("R2R_SKIP_ARCHOS");
|
||||
bool skip_archos = sa? !strcmp (sa, "1"): false;
|
||||
free (sa);
|
||||
if (sa) {
|
||||
if (skip_archos) {
|
||||
if ((!strcmp (path, "archos") || r_str_endswith (path, R_SYS_DIR"archos"))
|
||||
&& strcmp (subname, R2R_ARCH_OS)) {
|
||||
eprintf ("Skipping %s"R_SYS_DIR"%s because it does not match the current platform.\n", path, subname);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* radare - LGPL - Copyright 2020 - thestr4ng3r */
|
||||
/* radare - LGPL - Copyright 2020-2021 - thestr4ng3r */
|
||||
|
||||
#include "r2r.h"
|
||||
#include <assert.h>
|
||||
|
@ -3030,8 +3030,18 @@ static bool ds_print_meta_infos(RDisasmState *ds, ut8* buf, int len, int idx, in
|
||||
if (!ds_print_data_type (ds, buf + idx, ds->hint? ds->hint->immbase: 0, size)) {
|
||||
if (size > delta) {
|
||||
r_cons_printf ("hex size=%d delta=%d\n", size , delta);
|
||||
r_print_hexdump (core->print, ds->at,
|
||||
buf + idx, size - delta, 16, 1, 1);
|
||||
int remaining = size - delta;
|
||||
remaining = R_MAX (remaining, 0);
|
||||
if (remaining > (len - delta)) {
|
||||
ut8 *b = calloc (1, size - delta);
|
||||
memcpy (b, buf, len);
|
||||
r_print_hexdump (core->print, ds->at,
|
||||
b + idx, remaining, 16, 1, 1);
|
||||
free (b);
|
||||
} else {
|
||||
r_print_hexdump (core->print, ds->at,
|
||||
buf + idx, remaining, 16, 1, 1);
|
||||
}
|
||||
} else {
|
||||
r_cons_printf ("hex size=%d hexlen=%d delta=%d",
|
||||
size, hexlen, delta);
|
||||
|
Loading…
x
Reference in New Issue
Block a user