From: Alessandro Ghedini Date: Thu, 8 Oct 2015 12:37:21 +0000 (+0200) Subject: Replace malloc+strlcpy with strdup X-Git-Tag: OpenSSL_1_0_1q~34 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=418c0511610677c74ee63bd916ab3015e57ef40b;p=oweals%2Fopenssl.git Replace malloc+strlcpy with strdup Reviewed-by: Rich Salz Reviewed-by: Richard Levitte (cherry picked from commit 8acaabec429b39f9436f6a88006384d72d292539) --- diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c index faca9aeb57..68c77cec7d 100644 --- a/crypto/conf/conf_def.c +++ b/crypto/conf/conf_def.c @@ -225,12 +225,11 @@ static int def_load_bio(CONF *conf, BIO *in, long *line) goto err; } - section = (char *)OPENSSL_malloc(10); + section = BUF_strdup("default"); if (section == NULL) { CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE); goto err; } - BUF_strlcpy(section, "default", 10); if (_CONF_new_data(conf) == 0) { CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE);