summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbeck <>2018-03-22 15:54:46 +0000
committerbeck <>2018-03-22 15:54:46 +0000
commit62540710d193a8120bb7efa8d79a080971b587d3 (patch)
tree124f238272266eac335989d9a2f40924a8e28c0d
parent06cedd6f2ac65939a767213f243a7c11aef2d0be (diff)
downloadopenbsd-62540710d193a8120bb7efa8d79a080971b587d3.tar.gz
openbsd-62540710d193a8120bb7efa8d79a080971b587d3.tar.bz2
openbsd-62540710d193a8120bb7efa8d79a080971b587d3.zip
Call strlen() if name length provided is 0, like OpenSSL does.
Issue notice by Christian Heimes <christian@python.org> ok deraadt@ jsing@
-rw-r--r--src/lib/libcrypto/x509/x509_vpm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libcrypto/x509/x509_vpm.c b/src/lib/libcrypto/x509/x509_vpm.c
index e0111d2f17..0897137697 100644
--- a/src/lib/libcrypto/x509/x509_vpm.c
+++ b/src/lib/libcrypto/x509/x509_vpm.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_vpm.c,v 1.16 2017/12/09 07:09:25 deraadt Exp $ */ 1/* $OpenBSD: x509_vpm.c,v 1.17 2018/03/22 15:54:46 beck Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2004. 3 * project 2004.
4 */ 4 */
@@ -130,6 +130,8 @@ int_x509_param_set_hosts(X509_VERIFY_PARAM_ID *id, int mode,
130{ 130{
131 char *copy; 131 char *copy;
132 132
133 if (name != NULL && namelen == 0)
134 namelen = strlen(name);
133 /* 135 /*
134 * Refuse names with embedded NUL bytes. 136 * Refuse names with embedded NUL bytes.
135 * XXX: Do we need to push an error onto the error stack? 137 * XXX: Do we need to push an error onto the error stack?