]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
allow for 'ref=PROTOCOL' as a bare word
authorAlan T. DeKok <aland@freeradius.org>
Wed, 6 Jul 2022 15:40:40 +0000 (11:40 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 6 Jul 2022 15:41:53 +0000 (11:41 -0400)
src/lib/util/dict_fixup.c
src/lib/util/dict_util.c

index 2a3e0146b54987c41b378271095da05d5c462474..72570425b3e55ed665e5b8df8142dbf374cbab7a 100644 (file)
@@ -293,6 +293,14 @@ static fr_dict_attr_t const *dict_find_or_load_reference(fr_dict_t **dict_def, c
         */
        if (slen == 0) goto invalid_reference;
 
+       /*
+        *      Just a bare reference to the protocol.  Use the root.
+        */
+       if (!ref[slen]) {
+               *dict_def = dict;
+               return fr_dict_root(dict);
+       }
+
        /*
         *      Look up the attribute.
         */
index 553d9f2fd6146496cfcfb3afe7d42b6114037aff..b43aa1e9cfecd6f1767c261be3df8eba38865a9a 100644 (file)
@@ -1995,7 +1995,7 @@ ssize_t dict_by_protocol_substr(fr_dict_attr_err_t *err,
         *      If what we stopped at wasn't a '.', then there
         *      can't be a protocol name in this string.
         */
-       if (*(our_name.p) != '.') {
+       if (*(our_name.p) && (*(our_name.p) != '.')) {
                memcpy(out, &dict_def, sizeof(*out));
                return 0;
        }