From 669def5ee28d1a4ae9f3c34dc5c6b73ab77b4ec7 Mon Sep 17 00:00:00 2001 From: deraadt Date: Fri, 18 Apr 2014 13:41:20 +0000 Subject: [PATCH] Use asprintf() for generating path, instead of multiple return-value-not-checked strlcpy and strlcat --- lib/libssl/src/apps/apps.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) 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; } -- 2.20.1