Skip to content

Commit

Permalink
Check function APIs nullability for #23490
Browse files Browse the repository at this point in the history
  • Loading branch information
astralia committed Nov 28, 2024
1 parent d638a06 commit 14b8b51
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libr/anal/function.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ static void label_addrs_kv_free(HtPPKv *kv) {
}

R_API RAnalFunction *r_anal_function_new(RAnal *anal) {
R_RETURN_VAL_IF_FAIL (anal, NULL);
RAnalFunction *fcn = R_NEW0 (RAnalFunction);
if (!fcn) {
return NULL;
Expand Down Expand Up @@ -316,11 +317,13 @@ R_API ut64 r_anal_function_min_addr(RAnalFunction *fcn) {
}

R_API ut64 r_anal_function_max_addr(RAnalFunction *fcn) {
R_RETURN_VAL_IF_FAIL (fcn, 0);
ensure_fcn_range (fcn);
return fcn->meta._max;
}

R_API ut64 r_anal_function_size_from_entry(RAnalFunction *fcn) {
R_RETURN_VAL_IF_FAIL (fcn, 0);
ensure_fcn_range (fcn);
return fcn->meta._min == UT64_MAX ? 0 : fcn->meta._max - fcn->addr;
}
Expand Down

0 comments on commit 14b8b51

Please sign in to comment.