1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

dirmngr: Replace stpcpy chains by strconcat.

* dirmngr/certcache.c (find_cert_bysn): Use strconcat.
(find_cert_bysubject): Ditto.
* dirmngr/http.c (store_header): Ditto.
* dirmngr/ldap.c (make_url): Ditto.
* dirmngr/server.c (get_cert_local_ski): Ditto.
(do_get_cert_local): Use xstrconcat.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2017-02-16 10:19:59 +01:00
parent 7a666ccb44
commit aef60abe6a
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
4 changed files with 14 additions and 31 deletions

View file

@ -445,26 +445,16 @@ make_url (char **url, const char *dn, const char *filter)
xfree (u_dn);
return err;
}
*url = malloc ( 8 + strlen (u_dn)
+ 1 + strlen (attrs)
+ 5 + strlen (u_filter) + 1 );
if (!*url)
{
err = gpg_error_from_errno (errno);
xfree (u_dn);
xfree (u_filter);
return err;
}
stpcpy (stpcpy (stpcpy (stpcpy (stpcpy (stpcpy (*url, "ldap:///"),
u_dn),
"?"),
attrs),
"?sub?"),
u_filter);
*url = strconcat ("ldap:///", u_dn, "?", attrs, "?sub?", u_filter, NULL);
if (!*url)
err = gpg_error_from_syserror ();
else
err = 0;
xfree (u_dn);
xfree (u_filter);
return 0;
return err;
}