]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
cleanups and checks for static analysis
authorAlan T. DeKok <aland@freeradius.org>
Fri, 27 Oct 2023 00:42:10 +0000 (20:42 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 27 Oct 2023 00:42:10 +0000 (20:42 -0400)
src/lib/util/pair_legacy.c
src/lib/util/pair_legacy.h

index 694b17f47656872b77e1c01078f3aabac9226403..a70737e0422a6b94f20e59dd2ee120dd71dfb016 100644 (file)
@@ -129,6 +129,8 @@ fr_slen_t fr_pair_list_afrom_substr(fr_pair_parse_t const *root, fr_pair_parse_t
        fr_sbuff_marker_t       lhs_m, rhs_m;
        fr_sbuff_t              our_in = FR_SBUFF(in);
 
+       if (!root->ctx || !root->da || !root->list) return 0;
+
 redo:
        fr_sbuff_adv_past_whitespace(&our_in, SIZE_MAX, NULL);
 
@@ -364,9 +366,7 @@ parse_rhs:
         *      The RHS is a list, go parse the nested attributes.
         */
        if (fr_sbuff_next_if_char(&our_in, '{')) {
-               fr_pair_parse_t child = (fr_pair_parse_t) {
-                       .depth = relative->depth + 1,
-               };
+               fr_pair_parse_t child = (fr_pair_parse_t) { };
 
                if (!fr_type_is_structural(vp->vp_type)) {
                        fr_strerror_const("Cannot assign list to leaf data type");
index a3965055333a007a2b705d4c1796dd4089ae5194..f5b46955dbc3b161d00ca5c798d01463a7e2459c 100644 (file)
@@ -45,7 +45,6 @@ typedef struct {
        TALLOC_CTX      *ctx;
        fr_dict_attr_t const *da;
        fr_pair_list_t  *list;
-       int             depth;
 } fr_pair_parse_t;
 
 fr_slen_t fr_pair_list_afrom_substr(fr_pair_parse_t const *root, fr_pair_parse_t *relative,