From: Alan T. DeKok Date: Thu, 20 Jul 2023 11:51:43 +0000 (-0400) Subject: member_num starts at 1, not 0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6611bdb5f8783d5fed11951ea099c7cbc061f316;p=thirdparty%2Ffreeradius-server.git member_num starts at 1, not 0 --- diff --git a/src/lib/util/dict_tokenize.c b/src/lib/util/dict_tokenize.c index bff7363da3a..fddcac55ce6 100644 --- a/src/lib/util/dict_tokenize.c +++ b/src/lib/util/dict_tokenize.c @@ -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? */