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>
This commit is contained in:
NIIBE Yutaka 2021-12-17 13:33:40 +09:00
parent e08225030d
commit a9b95b20a8
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}