From 8b76e15d2872a06d9243dec5ae6d236d60c7c78e Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Thu, 15 Jun 2006 01:42:25 +0000 Subject: [PATCH] fix ber_bvreplace() in case dst is NULL and src is empty --- libraries/liblber/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ); } -- 2.39.5