mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-02 03:32:04 +00:00
fix crash in r2 -A
crowell: http://jjdredd.github.io/petka2.exe crowell: http://jjdredd.github.io/petka.bt.txt
This commit is contained in:
parent
a1088bdbf9
commit
a70caf7160
@ -60,9 +60,15 @@ static RAnalVar *get_used_var(RAnal *anal, RAnalOp *op) {
|
||||
char *inst_key = sdb_fmt (0, "inst.0x%"PFMT64x".vars", op->addr);
|
||||
char *var_def = sdb_get (anal->sdb_fcns, inst_key, 0);
|
||||
struct VarUsedType vut;
|
||||
int fmt_len, i, ct = 0;
|
||||
RAnalVar *res;
|
||||
|
||||
if (!var_def) return NULL;
|
||||
// ensure that var_def is properly formatted.
|
||||
for (i = 0; i < strlen (var_def); ++i) {
|
||||
if (var_def == ',') ++ct;
|
||||
}
|
||||
if (ct != 2) return NULL;
|
||||
sdb_fmt_tobin (var_def, SDB_VARUSED_FMT, &vut);
|
||||
res = r_anal_var_get (anal, vut.fcn_addr, vut.type[0], vut.scope, vut.delta);
|
||||
sdb_fmt_free (&vut, SDB_VARUSED_FMT);
|
||||
|
Loading…
x
Reference in New Issue
Block a user