From: Howard Chu Date: Wed, 10 Dec 2014 02:06:50 +0000 (+0000) Subject: ITS#7995 fix slap_bv2undef_ad X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9accfbb73a86a9f0a39e11dce03ec77edf8ffd08;p=openldap ITS#7995 fix slap_bv2undef_ad --- diff --git a/servers/slapd/ad.c b/servers/slapd/ad.c index 246b900fac..6f6cb2f973 100644 --- a/servers/slapd/ad.c +++ b/servers/slapd/ad.c @@ -769,7 +769,8 @@ int slap_bv2undef_ad( desc->ad_cname.bv_len = bv->bv_len; desc->ad_cname.bv_val = (char *)(desc+1); - strcpy(desc->ad_cname.bv_val, bv->bv_val); + strncpy(desc->ad_cname.bv_val, bv->bv_val, bv->bv_len); + desc->ad_cname.bv_val[bv->bv_len] = '\0'; /* canonical to upper case */ ldap_pvt_str2upper( desc->ad_cname.bv_val );