]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/ad.c
Happy New Year
[openldap] / servers / slapd / ad.c
index 246b900facff56a5d12d1021c40945371e669c2b..3fd62fa7f9bf0a81a383af3ab32a93a141658b58 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2014 The OpenLDAP Foundation.
+ * Copyright 1998-2018 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -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 );