From: Alan T. DeKok Date: Thu, 17 Jun 2021 13:59:20 +0000 (-0400) Subject: prevent recursive includes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d5e1f6299a7f89b09554b2491f58965ed3b5d2b;p=thirdparty%2Ffreeradius-server.git prevent recursive includes --- diff --git a/src/lib/util/dict_fixup.c b/src/lib/util/dict_fixup.c index 7bab1076de6..a0cc2c7997d 100644 --- a/src/lib/util/dict_fixup.c +++ b/src/lib/util/dict_fixup.c @@ -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; }