fix ber_bvreplace() in case dst is NULL and src is empty

This commit is contained in:
Pierangelo Masarati 2006-06-15 01:42:25 +00:00
parent 3d7647fa4a
commit 8b76e15d28

View File

@ -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 );
}