From: Alan T. DeKok Date: Tue, 30 Nov 2021 14:05:03 +0000 (-0500) Subject: copy the string values, instead of shallow copies X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15a5881f0284a582021165f7632c5927f7edfd19;p=thirdparty%2Ffreeradius-server.git copy the string values, instead of shallow copies we're not allowing multiple refcounts for the same string, so the simplest solution is to just copy it whole-sale. --- diff --git a/src/lib/util/edit.c b/src/lib/util/edit.c index c59c89092b4..080f9d6bdc6 100644 --- a/src/lib/util/edit.c +++ b/src/lib/util/edit.c @@ -106,7 +106,7 @@ static int edit_undo(fr_edit_t *e) case FR_EDIT_VALUE: fr_assert(fr_type_is_leaf(vp->vp_type)); if (!fr_type_is_fixed_size(vp->vp_type)) fr_value_box_clear(&vp->data); - fr_value_box_copy_shallow(NULL, &vp->data, &e->data); + fr_value_box_copy(vp, &vp->data, &e->data); break; case FR_EDIT_CLEAR: @@ -360,10 +360,7 @@ static int edit_record(fr_edit_list_t *el, fr_edit_op_t op, fr_pair_t *vp, fr_pa fr_assert(ref == NULL); fr_assert(fr_type_is_leaf(vp->vp_type)); - fr_value_box_copy_shallow(NULL, &e->data, &vp->data); - if (!fr_type_is_fixed_size(vp->vp_type)) fr_value_box_memdup_shallow(&vp->data, vp->data.enumv, - e->data.vb_octets, e->data.vb_length, - e->data.tainted); + fr_value_box_copy(e, &e->data, &vp->data); break; case FR_EDIT_CLEAR: