From: Alan T. DeKok Date: Mon, 22 Aug 2022 22:09:55 +0000 (-0400) Subject: manually do the loops X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92b6958d7e133063adac62b1617e7a65a9aa128a;p=thirdparty%2Ffreeradius-server.git manually do the loops because the previous code resulted in `EXPAND -> NULL`, and this method doesn't --- diff --git a/src/lib/unlang/xlat_builtin.c b/src/lib/unlang/xlat_builtin.c index fe85f9994a1..ff638464ee4 100644 --- a/src/lib/unlang/xlat_builtin.c +++ b/src/lib/unlang/xlat_builtin.c @@ -1242,11 +1242,12 @@ static xlat_action_t xlat_func_untaint(UNUSED TALLOC_CTX *ctx, fr_dcursor_t *out UNUSED xlat_ctx_t const *xctx, UNUSED request_t *request, fr_value_box_list_t *in) { - fr_dcursor_t cursor_in; + fr_value_box_t *vb; - fr_dcursor_init(&cursor_in, in); fr_value_box_list_untaint(in); - fr_dcursor_merge(out, &cursor_in); + while ((vb = fr_dlist_pop_head(in)) != NULL) { + fr_dcursor_append(out, vb); + } return XLAT_ACTION_DONE; } @@ -1255,11 +1256,12 @@ static xlat_action_t xlat_func_taint(UNUSED TALLOC_CTX *ctx, fr_dcursor_t *out, UNUSED xlat_ctx_t const *xctx, UNUSED request_t *request, fr_value_box_list_t *in) { - fr_dcursor_t cursor_in; + fr_value_box_t *vb; - fr_dcursor_init(&cursor_in, in); fr_value_box_list_taint(in); - fr_dcursor_merge(out, &cursor_in); + while ((vb = fr_dlist_pop_head(in)) != NULL) { + fr_dcursor_append(out, vb); + } return XLAT_ACTION_DONE; }