From: Alan T. DeKok Date: Mon, 6 Dec 2021 19:11:23 +0000 (-0500) Subject: type "group" can only point to TLVs X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f69ba1e81095fbb7d36e8113c9b4300d631cc307;p=thirdparty%2Ffreeradius-server.git type "group" can only point to TLVs so not struct, not other groups, and not leaf types and reorder checks so that they match the existing order in dict_fixup.c --- diff --git a/src/lib/util/dict_tokenize.c b/src/lib/util/dict_tokenize.c index 33e1903b30..6e21dcb838 100644 --- a/src/lib/util/dict_tokenize.c +++ b/src/lib/util/dict_tokenize.c @@ -926,13 +926,18 @@ static int dict_read_process_attribute(dict_tokenize_ctx_t *ctx, char **argv, in } check: + talloc_free(ref); + + if (da->type != FR_TYPE_TLV) { + fr_strerror_const("References MUST be to an ATTRIBUTE of type 'tlv'"); + return -1; + } + if (fr_dict_attr_ref(da)) { fr_strerror_const("References MUST NOT refer to an ATTRIBUTE which also has 'ref=...'"); - talloc_free(ref); return -1; } - talloc_free(ref); self->dict = dict; dict_attr_ref_set(self, da);