summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2021-12-17 05:33:40 +0100
committerNIIBE Yutaka <gniibe@fsij.org>2021-12-17 05:33:40 +0100
commita9b95b20a8c358d9f8743acfa1076c3be4ff0ac1 (patch)
tree20e6a429bde0952697736beebe419b56ea1192a9
parentw32: Prepare for the case gcrypt.h will not include winsock2.h. (diff)
downloadgnupg2-a9b95b20a8c358d9f8743acfa1076c3be4ff0ac1.tar.xz
gnupg2-a9b95b20a8c358d9f8743acfa1076c3be4ff0ac1.zip
dirmngr: Fix ldap-url.c.
* dirmngr/ldap-url.c (ldap_charray2str): Use memcpy instead of strncpy when length is computed by strlen beforhand. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
-rw-r--r--dirmngr/ldap-url.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dirmngr/ldap-url.c b/dirmngr/ldap-url.c
index 8308514d6..7268a4995 100644
--- a/dirmngr/ldap-url.c
+++ b/dirmngr/ldap-url.c
@@ -346,12 +346,12 @@ char * ldap_charray2str( char **a, const char *sep )
p = s;
for ( v = a; *v != NULL; v++ ) {
if ( v != a ) {
- strncpy( p, sep, slen );
+ memcpy( p, sep, slen );
p += slen;
}
len = strlen( *v );
- strncpy( p, *v, len );
+ memcpy( p, *v, len );
p += len;
}