]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
member_num starts at 1, not 0
authorAlan T. DeKok <aland@freeradius.org>
Thu, 20 Jul 2023 11:51:43 +0000 (07:51 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 20 Jul 2023 11:51:43 +0000 (07:51 -0400)
src/lib/util/dict_tokenize.c

index bff7363da3ac48f3fe299ca7d75784e15a7d2a81..fddcac55ce63c9dac71a365c6964a9bd76fc9e4a 100644 (file)
@@ -1367,7 +1367,10 @@ static int dict_read_process_member(dict_tokenize_ctx_t *ctx, char **argv, int a
        if (type == FR_TYPE_TLV) {
                int i;
 
-               for (i = 0; i <= ctx->stack[ctx->stack_depth].member_num; i++) {
+               /*
+                *      @todo - cache the key field in the stack frame, so we don't have to loop over the children.
+                */
+               for (i = 1; i <= ctx->stack[ctx->stack_depth].member_num; i++) {
                        da = dict_attr_child_by_num(ctx->stack[ctx->stack_depth].da, i);
                        if (!da) continue; /* really should be WTF? */