Skip to content

Commit

Permalink
Fix division by zero in r_anal_function_coverage ##crash
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Jan 7, 2025
1 parent 2e68499 commit a205678
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libr/anal/function.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,11 @@ R_API bool r_anal_function_was_modified(RAnalFunction *fcn) {
}

R_API int r_anal_function_coverage(RAnalFunction *fcn) {
R_RETURN_VAL_IF_FAIL (fcn, 0);
int total = r_list_length (fcn->bbs);
if (total == 0) {
return 0;
}
RListIter *iter;
RAnalBlock *bb;
int traced = 0;
Expand Down

0 comments on commit a205678

Please sign in to comment.