summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbeck <>2018-03-22 15:54:46 +0000
committerbeck <>2018-03-22 15:54:46 +0000
commit392838d9ccc5858d442a37443b91148e845c3381 (patch)
tree124f238272266eac335989d9a2f40924a8e28c0d /src
parentf33d843633a582f202f684491254bada42a8ec30 (diff)
downloadopenbsd-392838d9ccc5858d442a37443b91148e845c3381.tar.gz
openbsd-392838d9ccc5858d442a37443b91148e845c3381.tar.bz2
openbsd-392838d9ccc5858d442a37443b91148e845c3381.zip
Call strlen() if name length provided is 0, like OpenSSL does.
Issue notice by Christian Heimes <christian@python.org> ok deraadt@ jsing@
Diffstat (limited to 'src')
-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?