]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
don't cast TO or FROM structural types
authorAlan T. DeKok <aland@freeradius.org>
Fri, 5 Jan 2024 00:08:16 +0000 (19:08 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 5 Jan 2024 00:21:28 +0000 (19:21 -0500)
src/lib/unlang/xlat_builtin.c

index ce78fa738c1ce29d2faaaf589c8d43dc54b2f7f0..38b276a80148eccf328e5f5576dc5d1d58c4eac0 100644 (file)
@@ -219,13 +219,10 @@ void xlat_debug_attr_vp(request_t *request, fr_pair_t *vp, tmpl_t const *vpt)
 
                if ((fr_type_t) type->value == vp->vp_type) goto next_type;
 
-               switch (type->value) {
-               case FR_TYPE_NON_LEAF:  /* Skip everything that's not a value */
-                       goto next_type;
-
-               default:
-                       break;
-               }
+               /*
+                *      Don't cast TO structural, or FROM structural types.
+                */
+               if (!fr_type_is_leaf(type->value) || !fr_type_is_leaf(vp->vp_type)) goto next_type;
 
                MEM(dst = fr_value_box_alloc_null(vp));
                /* We expect some to fail */