]> git.sur5r.net Git - openldap/commitdiff
In build_new_dn, rdn may be part of a larger string, use strncopy.
authorHoward Chu <hyc@openldap.org>
Mon, 29 Nov 2004 04:03:56 +0000 (04:03 +0000)
committerHoward Chu <hyc@openldap.org>
Mon, 29 Nov 2004 04:03:56 +0000 (04:03 +0000)
servers/slapd/dn.c

index 151d6d35cee0ee66e37c2791952ef72408d0be63..42d4be5990c03a2a82ed90a4c9b4b24926bfc5ef 100644 (file)
@@ -1299,7 +1299,7 @@ build_new_dn( struct berval * new_dn,
        new_dn->bv_len = parent_dn->bv_len + newrdn->bv_len + 1;
        new_dn->bv_val = (char *) slap_sl_malloc( new_dn->bv_len + 1, memctx );
 
-       ptr = lutil_strcopy( new_dn->bv_val, newrdn->bv_val );
+       ptr = lutil_strncopy( new_dn->bv_val, newrdn->bv_val, newrdn->bv_len );
        *ptr++ = ',';
        strcpy( ptr, parent_dn->bv_val );
 }