From: Alan T. DeKok Date: Tue, 5 Nov 2019 00:59:44 +0000 (-0500) Subject: allow first member of STRUCT to be variable length X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f520d42b1c947ece05d467c5acfa10d5eabf6b0;p=thirdparty%2Ffreeradius-server.git allow first member of STRUCT to be variable length it's stupid, but it's what we need for keyed structures --- diff --git a/src/lib/util/dict_validate.c b/src/lib/util/dict_validate.c index e15e08441fe..d774acea47a 100644 --- a/src/lib/util/dict_validate.c +++ b/src/lib/util/dict_validate.c @@ -631,17 +631,14 @@ bool dict_attr_flags_valid(fr_dict_t *dict, fr_dict_attr_t const *parent, if (!attr) break; - if (*attr == 1) { - /* - * The first child can't be variable length, that's stupid. - * - * STRUCTs will have their length filled in later. - */ - if ((type != FR_TYPE_STRUCT) && (flags->length == 0)) { - fr_strerror_printf("Children of 'struct' type attributes MUST have fixed length."); - return false; - } - } else { + /* + * If we have keyed structs, then the first + * member can be variable length. + * + * For subsequent children, have each one check + * the previous child. + */ + if (*attr != 1) { int i; fr_dict_attr_t const *sibling;