]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
manually do the loops
authorAlan T. DeKok <aland@freeradius.org>
Mon, 22 Aug 2022 22:09:55 +0000 (18:09 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 23 Aug 2022 03:01:02 +0000 (23:01 -0400)
because the previous code resulted in `EXPAND -> NULL`, and this
method doesn't

src/lib/unlang/xlat_builtin.c

index fe85f9994a1ad3f8e12d0bdff81438a28a9e4d81..ff638464ee4811a05aed419683df05cc6a409c00 100644 (file)
@@ -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;
 }