From: Arran Cudbard-Bell Date: Fri, 8 Oct 2021 16:21:07 +0000 (-0500) Subject: Fix direct manipulation of boxes in xlat_builtin.c X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1e0daf26115a6e68648e0981b5867a72dc3d207;p=thirdparty%2Ffreeradius-server.git Fix direct manipulation of boxes in xlat_builtin.c --- diff --git a/src/lib/unlang/xlat_builtin.c b/src/lib/unlang/xlat_builtin.c index 569629665eb..7386425b5df 100644 --- a/src/lib/unlang/xlat_builtin.c +++ b/src/lib/unlang/xlat_builtin.c @@ -2100,15 +2100,13 @@ static xlat_action_t xlat_func_pairs(TALLOC_CTX *ctx, fr_dcursor_t *out, fr_token_t op = vp->op; char *buff; - MEM(vb = fr_value_box_alloc(ctx, FR_TYPE_STRING, NULL, false)); + MEM(vb = fr_value_box_alloc_null(ctx)); vp->op = T_OP_EQ; fr_pair_aprint(vb, &buff, NULL, vp); vp->op = op; - vb->vb_strvalue = buff; - vb->vb_length = talloc_array_length(buff) - 1; - + fr_value_box_bstrdup_buffer_shallow(NULL, vb, NULL, buff, false); fr_dcursor_append(out, vb); } tmpl_pair_cursor_clear(&cc);