Skip to content

Commit

Permalink
Fix a double free. (#3918)
Browse files Browse the repository at this point in the history
If the operand is rw, av gets assigned to op->src[i] and op->dst.
Later when op is freed, op->src[i] and op->dst are freed both and
so we run into the double free.
  • Loading branch information
Rot127 authored Oct 16, 2023
1 parent 7c4ceb3 commit 51c8be0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions librz/analysis/p/analysis_tricore_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,9 @@ static void rz_analysis_tricore_fillval(RzAnalysis *a, RzAnalysisOp *op, csh han
if (op->dst) {
rz_warn_if_reached();
}
if (av == op->src[srci - 1]) {
av = rz_mem_dup(av, sizeof(RzAnalysisValue));
}
op->dst = av;
}
}
Expand Down

0 comments on commit 51c8be0

Please sign in to comment.