]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
if the tmpl is unresolved, set the type to UNRESOLVED
authorAlan T. DeKok <aland@freeradius.org>
Mon, 25 May 2026 03:31:39 +0000 (23:31 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 25 May 2026 03:39:11 +0000 (23:39 -0400)
src/lib/server/tmpl_tokenize.c

index 7b619bd0d5c502789bce229fba51f113664f1bee..21bae070b0a518db5f5eaabae1ccf703d1afed4e 100644 (file)
@@ -1694,9 +1694,14 @@ fr_slen_t tmpl_attr_ref_afrom_unresolved_substr(TALLOC_CTX *ctx, tmpl_attr_error
                if (tmpl_attr_parse_filter(err, ar, &our_name, at_rules) < 0) goto error;
 
                /*
-               *       Insert the ar into the list of attribute references
-               */
+                *      Insert the ar into the list of attribute references
+                *
+                *      The tmpl is no longer a pure TMPL_TYPE_ATTR.  We have to convert it to an unresolved
+                *      one.  If we don't do this, then tmpl_afrom_attr_substr() would walk the ar list
+                *      expecting every ar->ar_da to be non-NULL, and would crash on the UNRESOLVED entry.
+                */
                tmpl_attr_insert(vpt, ar);
+               vpt->type = TMPL_TYPE_ATTR_UNRESOLVED;
 
                /*
                *       Once one OID component is created as unresolved all