]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
prevent recursive includes
authorAlan T. DeKok <aland@freeradius.org>
Thu, 17 Jun 2021 13:59:20 +0000 (09:59 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 17 Jun 2021 13:59:20 +0000 (09:59 -0400)
src/lib/util/dict_fixup.c

index 7bab1076de6f6cb6f556ef053688ef49f7478212..a0cc2c7997dec35a1655e903c53bcbfecaff3ad8 100644 (file)
@@ -249,6 +249,14 @@ static fr_dict_attr_t const *dict_find_or_load_reference(fr_dict_t **dict_def, c
 
                if (p) *p = '\0';
 
+               /*
+                *      Can't load the dictionary we're loading.
+                */
+               if (dict == *dict_def) {
+                       fr_strerror_printf("Cannot reference parent dictionary %s from within the same dictionary", fr_dict_root(dict)->name);
+                       return NULL;
+               }
+
                if (fr_dict_protocol_afrom_file(&other, ref, NULL, filename) < 0) {
                        return NULL;
                }