summaryrefslogtreecommitdiffstats
path: root/crypto/openssl/crypto/x509/x509_vpm.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssl/crypto/x509/x509_vpm.c')
-rw-r--r--crypto/openssl/crypto/x509/x509_vpm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/openssl/crypto/x509/x509_vpm.c b/crypto/openssl/crypto/x509/x509_vpm.c
index 592a8a5..1ac15a8 100644
--- a/crypto/openssl/crypto/x509/x509_vpm.c
+++ b/crypto/openssl/crypto/x509/x509_vpm.c
@@ -94,11 +94,11 @@ static int int_x509_param_set_hosts(X509_VERIFY_PARAM_ID *id, int mode,
* Refuse names with embedded NUL bytes, except perhaps as final byte.
* XXX: Do we need to push an error onto the error stack?
*/
- if (namelen == 0)
+ if (namelen == 0 || name == NULL)
namelen = name ? strlen(name) : 0;
else if (name && memchr(name, '\0', namelen > 1 ? namelen - 1 : namelen))
return 0;
- if (name && name[namelen - 1] == '\0')
+ if (namelen > 0 && name[namelen - 1] == '\0')
--namelen;
if (mode == SET_HOST && id->hosts) {
OpenPOWER on IntegriCloud