From: Alan T. DeKok Date: Fri, 5 Jan 2024 00:08:16 +0000 (-0500) Subject: don't cast TO or FROM structural types X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54b86d26c6c7448c110e8d2200a2b7f3216429cf;p=thirdparty%2Ffreeradius-server.git don't cast TO or FROM structural types --- diff --git a/src/lib/unlang/xlat_builtin.c b/src/lib/unlang/xlat_builtin.c index ce78fa738c1..38b276a8014 100644 --- a/src/lib/unlang/xlat_builtin.c +++ b/src/lib/unlang/xlat_builtin.c @@ -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 */