mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-23 21:29:49 +00:00
Fix a NULL dereference
This commit is contained in:
parent
6b5460c6a4
commit
29e8668e51
@ -110,15 +110,16 @@ R_API void r_anal_ex_clone_op_switch_to_bb (RAnalBlock *bb, RAnalOp *op) {
|
||||
RListIter *iter;
|
||||
RAnalCaseOp *caseop = NULL;
|
||||
|
||||
if ( op->switch_op ) {
|
||||
if (op->switch_op) {
|
||||
|
||||
bb->switch_op = r_anal_switch_op_new (op->switch_op->addr,
|
||||
op->switch_op->min_val,
|
||||
op->switch_op->max_val);
|
||||
|
||||
r_list_foreach (op->switch_op->cases, iter, caseop) {
|
||||
r_anal_switch_op_add_case (bb->switch_op, caseop->addr,
|
||||
if (bb->switch_op){
|
||||
r_list_foreach (op->switch_op->cases, iter, caseop) {
|
||||
r_anal_switch_op_add_case (bb->switch_op, caseop->addr,
|
||||
caseop->value, caseop->jump);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
RAnalSwitchOp *switch_op_new() {
|
||||
RAnalSwitchOp * swop = R_NEW0 (RAnalSwitchOp);
|
||||
if (!swop) return NULL;
|
||||
swop->cases = r_list_new ();
|
||||
swop->cases->free = (void *)free;
|
||||
swop->min_val = swop->def_val = swop->max_val = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user