From: Alan T. DeKok Date: Thu, 4 Dec 2025 15:12:50 +0000 (-0500) Subject: handle the case of internal attributes in protocol structures X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1d9319e5a9f00a1e76660b601710df3f85dd5ec;p=thirdparty%2Ffreeradius-server.git handle the case of internal attributes in protocol structures --- diff --git a/src/lib/util/pair_print.c b/src/lib/util/pair_print.c index 5d865d96c4f..443f7f3dfc1 100644 --- a/src/lib/util/pair_print.c +++ b/src/lib/util/pair_print.c @@ -19,12 +19,18 @@ * * @todo - parent should _never_ be vp->da. */ -#define fr_pair_reset_parent(parent) do { \ - if (parent && (parent->type == FR_TYPE_GROUP)) { \ - parent = fr_dict_attr_ref(parent); \ - if (parent->flags.is_root) parent = NULL; \ - } \ - if (parent && (parent == vp->da)) parent = NULL; \ +#define fr_pair_reset_parent(parent) do { \ + if (!parent) break; \ + fr_assert(parent != vp->da); \ + fr_assert(fr_type_is_structural(parent->type)); \ + if (parent->type == FR_TYPE_GROUP) { \ + parent = fr_dict_attr_ref(parent); \ + if (parent->flags.is_root) { \ + parent = NULL; \ + break; \ + } \ + } \ + if (parent->dict != vp->da->dict) parent = NULL; \ } while (0) /** Pair serialisation API