]> git.sur5r.net Git - openldap/commitdiff
Fix nul ('\0') string termination bug introduced by use of
authorKurt Zeilenga <kurt@openldap.org>
Thu, 18 May 2000 16:44:32 +0000 (16:44 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 18 May 2000 16:44:32 +0000 (16:44 +0000)
memalloc/memcpy instead of strdup

libraries/libldif/line64.c

index 4af9649a9f2b5a31bf8d0db76a83facab18ad962..7ee83d8e6ad56588cdb850b6359dc61b4ca5d5ac 100644 (file)
@@ -223,7 +223,7 @@ done:
        }
 
        if( !url && value != NULL ) {
-               p = ber_memalloc( vlen );
+               p = ber_memalloc( vlen + 1 );
                if( p == NULL ) {
                        ber_pvt_log_printf( LDAP_DEBUG_ANY, ldif_debug,
                                "ldif_parse_line: value malloc failed\n");
@@ -232,6 +232,7 @@ done:
                        return( -1 );
                }
                memcpy( p, value, vlen );
+               p[vlen] = '\0';
                value = p;
        }