From: Pierangelo Masarati Date: Wed, 22 Aug 2007 17:46:55 +0000 (+0000) Subject: fix subtree rename integrity; curiously enough, tes023 only failed on 64 bit arch... X-Git-Tag: OPENLDAP_REL_ENG_2_4_MP~137 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7c9f63a60d535498d78dc2734a3537dfd382354c;p=openldap fix subtree rename integrity; curiously enough, tes023 only failed on 64 bit arch; probably because we'd need to double the stack of the slab on 64 bit archs... --- diff --git a/servers/slapd/overlays/refint.c b/servers/slapd/overlays/refint.c index 3f8d91123a..4afc7204e1 100644 --- a/servers/slapd/overlays/refint.c +++ b/servers/slapd/overlays/refint.c @@ -414,12 +414,15 @@ refint_search_cb( if ( !BER_BVISEMPTY( &rq->newdn ) && b[i].bv_len != rq->oldndn.bv_len ) { - struct berval newsub, newdn; + struct berval newsub, newdn, olddn, oldndn; /* if not first, save first as well */ if ( first != -1 ) { - ber_bvarray_add_x( &na->old_vals, &a->a_vals[first], op->o_tmpmemctx ); - ber_bvarray_add_x( &na->old_nvals, &a->a_nvals[first], op->o_tmpmemctx ); + + ber_dupbv_x( &olddn, &a->a_vals[first], op->o_tmpmemctx ); + ber_bvarray_add_x( &na->old_vals, &olddn, op->o_tmpmemctx ); + ber_dupbv_x( &oldndn, &a->a_nvals[first], op->o_tmpmemctx ); + ber_bvarray_add_x( &na->old_nvals, &oldndn, op->o_tmpmemctx ); newsub = a->a_vals[first]; newsub.bv_len -= rq->olddn.bv_len + 1; @@ -438,8 +441,10 @@ refint_search_cb( first = -1; } - ber_bvarray_add_x( &na->old_vals, &a->a_vals[i], op->o_tmpmemctx ); - ber_bvarray_add_x( &na->old_nvals, &a->a_nvals[i], op->o_tmpmemctx ); + ber_dupbv_x( &olddn, &a->a_vals[i], op->o_tmpmemctx ); + ber_bvarray_add_x( &na->old_vals, &olddn, op->o_tmpmemctx ); + ber_dupbv_x( &oldndn, &a->a_nvals[i], op->o_tmpmemctx ); + ber_bvarray_add_x( &na->old_nvals, &oldndn, op->o_tmpmemctx ); newsub = a->a_vals[i]; newsub.bv_len -= rq->olddn.bv_len + 1;