]> git.sur5r.net Git - openldap/commitdiff
ITS#7995 fix slap_bv2undef_ad
authorHoward Chu <hyc@openldap.org>
Wed, 10 Dec 2014 02:06:50 +0000 (02:06 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 10 Dec 2014 02:06:50 +0000 (02:06 +0000)
servers/slapd/ad.c

index 246b900facff56a5d12d1021c40945371e669c2b..6f6cb2f973199b757872313ff5b5506ac4129ca4 100644 (file)
@@ -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 );