summaryrefslogtreecommitdiffstats
path: root/crypto/x509v3/v3_utl.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/x509v3/v3_utl.c')
-rw-r--r--crypto/x509v3/v3_utl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/x509v3/v3_utl.c b/crypto/x509v3/v3_utl.c
index 6e91ac9816..5401d90e10 100644
--- a/crypto/x509v3/v3_utl.c
+++ b/crypto/x509v3/v3_utl.c
@@ -972,6 +972,10 @@ static int do_x509_check(X509 *x, const unsigned char *chk, size_t chklen,
int X509_check_host(X509 *x, const unsigned char *chk, size_t chklen,
unsigned int flags)
{
+ if (chklen == 0)
+ chklen = chk ? strlen((char *)chk) : 0;
+ else if (chk && memchr(chk, '\0', chklen))
+ return 0;
return do_x509_check(x, chk, chklen, flags, GEN_DNS);
}