]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Annotate xlat uses of known good values from dlsts (CIDs follow) (#4708)
authorJames Jones <jejones3141@gmail.com>
Mon, 12 Sep 2022 23:41:09 +0000 (18:41 -0500)
committerGitHub <noreply@github.com>
Mon, 12 Sep 2022 23:41:09 +0000 (19:41 -0400)
By the time these functions are called, the dlists are known
to have the needed list items.

CIDs: 150663415066351506636150663715066381506639,
      1506640150664115066421506643

src/lib/eap_aka_sim/xlat.c
src/lib/unlang/xlat_builtin.c
src/modules/rlm_unbound/rlm_unbound.c
src/modules/rlm_unpack/rlm_unpack.c

index 5f92c43dbc983bcdb5c92bf33300a3777e84bb51..09f9ba5c5704f30ff393a94cea4a66179736df22 100644 (file)
@@ -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;
 
index c623d7927857d2922e088e3726da19466ca87f45..3aace4f66d6c3d4a5ab68a84c8e2b9a2b9bdc9ce 100644 (file)
@@ -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 == '/') {
index 3185752ef038d35dc608b10dc5f83ba26bead610..50945ffda490e02216dbfbfd95e1990911df9ebf 100644 (file)
@@ -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)
index adc6b7fe2636748bc8596d6656c76718d976cd2d..ffb4fac8572742839ce869600578950861991b8c 100644 (file)
@@ -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);