From 835d0ebd63b967a46d25001b4bb7c56fe72366f9 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 17 May 2000 05:21:03 +0000 Subject: [PATCH] Fix ldif_parse_line, binary attributes got truncated because the final value was copied with ber_strdup. --- libraries/libldif/line64.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 ); -- 2.39.5