From: James Jones Date: Mon, 12 Sep 2022 23:41:09 +0000 (-0500) Subject: Annotate xlat uses of known good values from dlsts (CIDs follow) (#4708) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8073feb4f9c13d9090a2ea5baf6dc77bf44e1182;p=thirdparty%2Ffreeradius-server.git Annotate xlat uses of known good values from dlsts (CIDs follow) (#4708) By the time these functions are called, the dlists are known to have the needed list items. CIDs: 1506634, 1506635, 1506636, 1506637, 1506638, 1506639, 1506640, 1506641, 1506642, 1506643 --- diff --git a/src/lib/eap_aka_sim/xlat.c b/src/lib/eap_aka_sim/xlat.c index 5f92c43dbc9..09f9ba5c570 100644 --- a/src/lib/eap_aka_sim/xlat.c +++ b/src/lib/eap_aka_sim/xlat.c @@ -236,6 +236,7 @@ static xlat_action_t aka_sim_3gpp_temporary_id_decrypt_xlat(TALLOC_CTX *ctx, fr_ size_t id_len = id_vb->vb_length; fr_value_box_t *key_vb = fr_dlist_next(in, id_vb); + /* coverity[dereference] */ uint8_t const *key = key_vb->vb_octets; size_t key_len = key_vb->vb_length; @@ -355,6 +356,7 @@ static xlat_action_t aka_sim_3gpp_temporary_id_encrypt_xlat(TALLOC_CTX *ctx, fr_ size_t id_len = id_vb->vb_length; fr_value_box_t *key_vb = fr_dlist_next(in, id_vb); + /* coverity[dereference] */ uint8_t const *key = key_vb->vb_octets; size_t key_len = key_vb->vb_length; diff --git a/src/lib/unlang/xlat_builtin.c b/src/lib/unlang/xlat_builtin.c index c623d792785..3aace4f66d6 100644 --- a/src/lib/unlang/xlat_builtin.c +++ b/src/lib/unlang/xlat_builtin.c @@ -1299,6 +1299,7 @@ static xlat_action_t xlat_func_explode(TALLOC_CTX *ctx, fr_dcursor_t *out, char const *delim; fr_value_box_t *string, *vb; + /* coverity[dereference] */ if (delim_vb->vb_length == 0) { REDEBUG("Delimiter must be greater than zero characters"); return XLAT_ACTION_FAIL; @@ -1858,6 +1859,7 @@ static xlat_action_t xlat_func_lpad(UNUSED TALLOC_CTX *ctx, fr_dcursor_t *out, fr_value_box_list_t *list = &values->vb_group; fr_value_box_t *pad = fr_dlist_next(args, values); size_t pad_len = (size_t)pad->vb_uint64; + /* coverity[dereference] */ fr_value_box_t *fill = fr_dlist_next(args, pad); char const *fill_str = NULL; size_t fill_len = 0; @@ -1945,6 +1947,7 @@ static xlat_action_t xlat_func_rpad(UNUSED TALLOC_CTX *ctx, fr_dcursor_t *out, fr_value_box_t *values = fr_dlist_head(args); fr_value_box_list_t *list = &values->vb_group; fr_value_box_t *pad = fr_dlist_next(args, values); + /* coverity[dereference] */ size_t pad_len = (size_t)pad->vb_uint64; fr_value_box_t *fill = fr_dlist_next(args, pad); char const *fill_str = NULL; @@ -3282,7 +3285,7 @@ static xlat_action_t xlat_func_subst_regex(TALLOC_CTX *ctx, fr_dcursor_t *out, fr_value_box_t *regex_vb = fr_dlist_next(in, subject_vb); fr_value_box_t *rep_vb = fr_dlist_next(in, regex_vb); - + /* coverity[dereference] */ p = regex_vb->vb_strvalue; end = p + regex_vb->vb_length; @@ -3382,6 +3385,7 @@ static xlat_action_t xlat_func_subst(TALLOC_CTX *ctx, fr_dcursor_t *out, fr_value_box_t *subject_vb = fr_dlist_head(in); fr_value_box_t *pattern_vb = fr_dlist_next(in, subject_vb); + /* coverity[dereference] */ pattern = pattern_vb->vb_strvalue; if (*pattern == '/') { diff --git a/src/modules/rlm_unbound/rlm_unbound.c b/src/modules/rlm_unbound/rlm_unbound.c index 3185752ef03..50945ffda49 100644 --- a/src/modules/rlm_unbound/rlm_unbound.c +++ b/src/modules/rlm_unbound/rlm_unbound.c @@ -380,6 +380,7 @@ static xlat_action_t xlat_unbound(TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_unbound_callback, &ur->async_id); \ } + /* coverity[dereference] */ UB_QUERY("A", 1, FR_TYPE_IPV4_ADDR, false) else UB_QUERY("AAAA", 28, FR_TYPE_IPV6_ADDR, false) else UB_QUERY("PTR", 12, FR_TYPE_STRING, false) diff --git a/src/modules/rlm_unpack/rlm_unpack.c b/src/modules/rlm_unpack/rlm_unpack.c index adc6b7fe263..ffb4fac8572 100644 --- a/src/modules/rlm_unpack/rlm_unpack.c +++ b/src/modules/rlm_unpack/rlm_unpack.c @@ -101,6 +101,7 @@ static xlat_action_t unpack_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out, return XLAT_ACTION_FAIL; } + /* coverity[dereference] */ type = fr_type_from_str(type_vb->vb_strvalue); if (fr_type_is_null(type)) { REDEBUG("Invalid data type '%s'", type_vb->vb_strvalue);