From: Howard Chu Date: Mon, 29 Nov 2004 04:03:56 +0000 (+0000) Subject: In build_new_dn, rdn may be part of a larger string, use strncopy. X-Git-Tag: OPENLDAP_REL_ENG_2_3_0ALPHA~187 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0145d54325674942cc1752d0e82d20e237da4f2f;p=openldap In build_new_dn, rdn may be part of a larger string, use strncopy. --- diff --git a/servers/slapd/dn.c b/servers/slapd/dn.c index 151d6d35ce..42d4be5990 100644 --- a/servers/slapd/dn.c +++ b/servers/slapd/dn.c @@ -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 ); }