From: Alan T. DeKok Date: Fri, 29 Jul 2022 13:12:58 +0000 (-0400) Subject: fix list_eval to return current from the cursor X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89025a31c6e2f0ec1f113c1aa99e2bf78f076f81;p=thirdparty%2Ffreeradius-server.git fix list_eval to return current from the cursor and not what was passed in. This mirrors the child_eval function. And remove the next_peek from NUM_LAST, which was unnecessary and was causing breakage --- diff --git a/src/lib/server/tmpl_dcursor.c b/src/lib/server/tmpl_dcursor.c index 2950f0201a9..1a91200c245 100644 --- a/src/lib/server/tmpl_dcursor.c +++ b/src/lib/server/tmpl_dcursor.c @@ -107,10 +107,13 @@ void _tmpl_cursor_leaf_init(TALLOC_CTX *list_ctx, fr_pair_list_t *list, tmpl_att /** Stub list eval function until we can remove lists * */ -static fr_pair_t *_tmpl_cursor_list_eval(UNUSED fr_dlist_head_t *list_head, fr_pair_t *curr, tmpl_dcursor_nested_t *ns) +static fr_pair_t *_tmpl_cursor_list_eval(UNUSED fr_dlist_head_t *list_head, UNUSED fr_pair_t *current, tmpl_dcursor_nested_t *ns) { + fr_pair_t *vp; + + vp = fr_dcursor_current(&ns->cursor); fr_dcursor_next(&ns->cursor); - return curr; + return vp; } static inline CC_HINT(always_inline) @@ -181,8 +184,6 @@ fr_pair_t *_tmpl_cursor_eval(fr_dlist_head_t *list_head, fr_pair_t *curr, tmpl_d vp = NULL; while ((iter = ns->func(list_head, iter, ns))) { vp = iter; - - if (!fr_dcursor_next_peek(&ns->cursor)) break; } _tmpl_cursor_common_pop(cc); break;