Commit 088eecc3 authored by Howard Chu's avatar Howard Chu
Browse files

Tweak strcpy's

parent af680490
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "ldap_pvt.h" #include "ldap_pvt.h"
#include "slap.h" #include "slap.h"
#include "lutil.h"
typedef struct Attr_option { typedef struct Attr_option {
struct berval name; /* option name or prefix */ struct berval name; /* option name or prefix */
...@@ -352,16 +353,13 @@ done:; ...@@ -352,16 +353,13 @@ done:;
j = (lp j = (lp
? lp - desc.ad_tags.bv_val - 1 ? lp - desc.ad_tags.bv_val - 1
: strlen( desc.ad_tags.bv_val )); : strlen( desc.ad_tags.bv_val ));
strncpy(cp, desc.ad_tags.bv_val, j); cp = lutil_strncopy(cp, desc.ad_tags.bv_val, j);
cp += j;
} }
} }
strcpy(cp, ";binary"); cp = lutil_strcopy(cp, ";binary");
cp += sizeof(";binary")-1;
if( lp != NULL ) { if( lp != NULL ) {
*cp++ = ';'; *cp++ = ';';
strcpy(cp, lp); cp = lutil_strcopy(cp, lp);
cp += strlen( cp );
} }
d2->ad_cname.bv_len = cp - d2->ad_cname.bv_val; d2->ad_cname.bv_len = cp - d2->ad_cname.bv_val;
if( desc.ad_tags.bv_len ) if( desc.ad_tags.bv_len )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment