]> git.sur5r.net Git - openldap/commitdiff
Fix ldif_parse_line, binary attributes got truncated because the final
authorHoward Chu <hyc@openldap.org>
Wed, 17 May 2000 05:21:03 +0000 (05:21 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 17 May 2000 05:21:03 +0000 (05:21 +0000)
value was copied with ber_strdup.

libraries/libldif/line64.c

index d12ba1866cd139b410d5802c6d0cea1fb900cdce..4af9649a9f2b5a31bf8d0db76a83facab18ad962 100644 (file)
@@ -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 );