[vlc-commits] gnutls: fix flawed logic
Rémi Denis-Courmont
git at videolan.org
Fri Aug 22 22:44:40 CEST 2014
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Aug 22 23:22:44 2014 +0300| [52500eb759c39c75cc98338cdb65ea64873fb09c] | committer: Rémi Denis-Courmont
gnutls: fix flawed logic
val is always zero in the removed code; the verification status is what
actually matters.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=52500eb759c39c75cc98338cdb65ea64873fb09c
---
modules/misc/gnutls.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/modules/misc/gnutls.c b/modules/misc/gnutls.c
index 83d154f..da6c0e5 100644
--- a/modules/misc/gnutls.c
+++ b/modules/misc/gnutls.c
@@ -378,6 +378,9 @@ static int gnutls_HandshakeAndValidate (vlc_tls_t *session, const char *host,
return -1;
}
+ if (host == NULL)
+ return status ? -1 : 0;
+
/* certificate (host)name verification */
const gnutls_datum_t *data;
unsigned count;
@@ -389,8 +392,6 @@ static int gnutls_HandshakeAndValidate (vlc_tls_t *session, const char *host,
}
msg_Dbg (session, "%u certificate(s) in the list", count);
- if (val || host == NULL)
- return val;
if (status && gnutls_CertSearch (session, host, service, data))
return -1;
More information about the vlc-commits
mailing list