From: Howard Chu Date: Wed, 17 May 2000 05:21:03 +0000 (+0000) Subject: Fix ldif_parse_line, binary attributes got truncated because the final X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2930 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=835d0ebd63b967a46d25001b4bb7c56fe72366f9;p=openldap Fix ldif_parse_line, binary attributes got truncated because the final value was copied with ber_strdup. --- diff --git a/libraries/libldif/line64.c b/libraries/libldif/line64.c index d12ba1866c..4af9649a9f 100644 --- a/libraries/libldif/line64.c +++ b/libraries/libldif/line64.c @@ -223,14 +223,16 @@ done: } if( !url && value != NULL ) { - value = ber_strdup( value ); - if( value == NULL ) { + p = ber_memalloc( vlen ); + if( p == NULL ) { ber_pvt_log_printf( LDAP_DEBUG_ANY, ldif_debug, "ldif_parse_line: value malloc failed\n"); ber_memfree( type ); ber_memfree( freeme ); return( -1 ); } + memcpy( p, value, vlen ); + value = p; } ber_memfree( freeme );