]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
allow string[n] to be used inside of structs, too
authorAlan T. DeKok <aland@freeradius.org>
Fri, 13 Aug 2021 13:53:30 +0000 (09:53 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 13 Aug 2021 17:53:26 +0000 (13:53 -0400)
src/lib/util/dict_tokenize.c

index f7125c029a0c299fb6d27adf4a69b7eba8a4cb57..947c2d49995cb471d9ac875a6f7905f7fbe33cc4 100644 (file)
@@ -983,7 +983,8 @@ static int dict_read_process_member(dict_tokenize_ctx_t *ctx, char **argv, int a
         *      so, complain if we're adding a variable sized member.
         */
        if (ctx->stack[ctx->stack_depth].da->flags.length &&
-           ((type == FR_TYPE_STRING) || (type == FR_TYPE_TLV) ||
+           ((type == FR_TYPE_TLV) ||
+            ((type == FR_TYPE_STRING) && !flags.length) ||
             ((type == FR_TYPE_OCTETS) && !flags.length))) {
                fr_strerror_printf("'struct' %s has fixed size %u, we cannot add a variable-sized member.",
                                   ctx->stack[ctx->stack_depth].da->name, ctx->stack[ctx->stack_depth].da->flags.length);