From: Pierangelo Masarati Date: Thu, 15 Jun 2006 01:42:25 +0000 (+0000) Subject: fix ber_bvreplace() in case dst is NULL and src is empty X-Git-Tag: OPENLDAP_REL_ENG_2_4_3ALPHA~9^2~102 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8b76e15d2872a06d9243dec5ae6d236d60c7c78e;p=openldap fix ber_bvreplace() in case dst is NULL and src is empty --- diff --git a/libraries/liblber/memory.c b/libraries/liblber/memory.c index f45ec52b68..614305c9ed 100644 --- a/libraries/liblber/memory.c +++ b/libraries/liblber/memory.c @@ -701,7 +701,7 @@ ber_bvreplace_x( struct berval *dst, LDAP_CONST struct berval *src, void *ctx ) { assert( dst != NULL ); - if ( dst->bv_len < src->bv_len ) { + if ( dst->bv_len == 0 || dst->bv_len < src->bv_len ) { dst->bv_val = ber_memrealloc_x( dst->bv_val, src->bv_len + 1, ctx ); }