From 9accfbb73a86a9f0a39e11dce03ec77edf8ffd08 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 10 Dec 2014 02:06:50 +0000 Subject: [PATCH] ITS#7995 fix slap_bv2undef_ad --- servers/slapd/ad.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 ); -- 2.39.5