]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
allow fixed-size data types to have "array" flag, too
authorAlan T. DeKok <aland@freeradius.org>
Fri, 11 Mar 2022 14:06:12 +0000 (09:06 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 11 Mar 2022 14:06:12 +0000 (09:06 -0500)
src/lib/util/dict_validate.c

index 742be8165e3cce4ef2152731c3cd59223f1b7597..1f28e5b218f85f23a0fe832f8f2a415798f0e205 100644 (file)
@@ -478,7 +478,18 @@ bool dict_attr_flags_valid(fr_dict_t *dict, fr_dict_attr_t const *parent,
        case FR_TYPE_STRUCT:
                ALLOW_FLAG(extra);
                ALLOW_FLAG(subtype);
-               if (flags->is_known_width) ALLOW_FLAG(array);
+
+               if (flags->array) {
+                       switch (type) {
+                       case FR_TYPE_FIXED_SIZE:
+                               ALLOW_FLAG(array);
+                               break;
+
+                       default:
+                               if (flags->is_known_width) ALLOW_FLAG(array);
+                               break;
+                       }
+               }
                if (all_flags) {
                        fr_strerror_const("Invalid flag for attribute inside of a 'struct'");
                        return false;