]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
our_parent cannot be NULL here
authorAlan T. DeKok <aland@freeradius.org>
Tue, 13 Dec 2022 19:34:46 +0000 (14:34 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 15 Dec 2022 14:19:35 +0000 (09:19 -0500)
src/lib/server/tmpl_tokenize.c

index 2cce8872dac01890a1b37995210d112bf8022e8d..7cef075db4ef996a5d73b19bc746f111e0ff3aac 100644 (file)
@@ -1652,6 +1652,8 @@ static inline int tmpl_attr_afrom_attr_substr(TALLOC_CTX *ctx, tmpl_attr_error_t
                 *      reference.
                 */
                if (da) {
+                       fr_assert(our_parent != NULL);
+
                        MEM(ar = talloc(ctx, tmpl_attr_t));
                        *ar = (tmpl_attr_t){
                                .ar_num = NUM_UNSPEC,
@@ -1686,6 +1688,8 @@ static inline int tmpl_attr_afrom_attr_substr(TALLOC_CTX *ctx, tmpl_attr_error_t
                goto error;
        }
 
+       fr_assert(our_parent != NULL);
+
        /*
         *      See if the ref begins with an unsigned integer
         *      if it does it's probably an OID component
@@ -1750,7 +1754,7 @@ static inline int tmpl_attr_afrom_attr_substr(TALLOC_CTX *ctx, tmpl_attr_error_t
                /*
                 *      Inherit the internal flag from our parent.
                 */
-               da_unknown->flags.internal = (parent == NULL) || parent->flags.internal;
+               da_unknown->flags.internal = our_parent->flags.internal;
 
                *ar = (tmpl_attr_t){
                        .ar_num = NUM_UNSPEC,