aboutsummaryrefslogtreecommitdiff
path: root/crypto/x509v3/v3_info.c
diff options
context:
space:
mode:
authorDmitry-Me <wipedout@yandex.ru>2016-03-01 11:48:15 +0300
committerRich Salz <rsalz@akamai.com>2016-03-03 19:44:10 -0500
commit5e04cfdef345c69a4bb04db81766702f994172f3 (patch)
tree6bb34b27543d1e896aef0ac4d91447d0c9f41c1e /crypto/x509v3/v3_info.c
parentaacfb134be2a88211b79dc53bb5bd0e422dbb60d (diff)
downloadopenssl-5e04cfdef345c69a4bb04db81766702f994172f3.zip
openssl-5e04cfdef345c69a4bb04db81766702f994172f3.tar.gz
openssl-5e04cfdef345c69a4bb04db81766702f994172f3.tar.bz2
GH769: Reuse strndup()
Reviewed-by: Matt Caswell <matt@openssl.org> Signed-off-by: Rich Salz <rsalz@akamai.com>
Diffstat (limited to 'crypto/x509v3/v3_info.c')
-rw-r--r--crypto/x509v3/v3_info.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/crypto/x509v3/v3_info.c b/crypto/x509v3/v3_info.c
index a7ea19a..16e25fa 100644
--- a/crypto/x509v3/v3_info.c
+++ b/crypto/x509v3/v3_info.c
@@ -177,13 +177,11 @@ static AUTHORITY_INFO_ACCESS *v2i_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD
ctmp.value = cnf->value;
if (!v2i_GENERAL_NAME_ex(acc->location, method, ctx, &ctmp, 0))
goto err;
- if ((objtmp = OPENSSL_malloc(objlen + 1)) == NULL) {
+ if ((objtmp = OPENSSL_strndup(cnf->name, objlen)) == NULL) {
X509V3err(X509V3_F_V2I_AUTHORITY_INFO_ACCESS,
ERR_R_MALLOC_FAILURE);
goto err;
}
- strncpy(objtmp, cnf->name, objlen);
- objtmp[objlen] = 0;
acc->method = OBJ_txt2obj(objtmp, 0);
if (!acc->method) {
X509V3err(X509V3_F_V2I_AUTHORITY_INFO_ACCESS,