From: deraadt Date: Fri, 18 Apr 2014 13:41:20 +0000 (+0000) Subject: Use asprintf() for generating path, instead of multiple X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=669def5ee28d1a4ae9f3c34dc5c6b73ab77b4ec7;p=openbsd Use asprintf() for generating path, instead of multiple return-value-not-checked strlcpy and strlcat --- diff --git a/lib/libssl/src/apps/apps.c b/lib/libssl/src/apps/apps.c index c0130d4cbc0..cb9f8b0058e 100644 --- a/lib/libssl/src/apps/apps.c +++ b/lib/libssl/src/apps/apps.c @@ -1324,15 +1324,9 @@ char * make_config_name() { const char *t = X509_get_default_cert_area(); - size_t len; char *p; - len = strlen(t) + strlen(OPENSSL_CONF) + 2; - p = malloc(len); - BUF_strlcpy(p, t, len); - BUF_strlcat(p, "/", len); - BUF_strlcat(p, OPENSSL_CONF, len); - + asprintf(&p, "%s/openssl.cnf", t); return p; }