]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
type "group" can only point to TLVs
authorAlan T. DeKok <aland@freeradius.org>
Mon, 6 Dec 2021 19:11:23 +0000 (14:11 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 7 Dec 2021 13:32:22 +0000 (08:32 -0500)
so not struct, not other groups, and not leaf types
and reorder checks so that they match the existing order in
dict_fixup.c

src/lib/util/dict_tokenize.c

index 33e1903b30e66f5867fde77b329026a973056d2a..6e21dcb8384b3ebc8e1298927802bdea98a5c1bc 100644 (file)
@@ -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);