From 6b5b1a02d46f761b691527c8e3c9a2ad08b0c3a5 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 18 Dec 2015 10:25:15 -0500 Subject: Fix a coverity NULL-pointer deref warning in the tortls tests. Also, make our cert validation code more NULL-resistant. This is CID 1327891. --- src/common/tortls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/common') diff --git a/src/common/tortls.c b/src/common/tortls.c index a1facec409..5e0c97096d 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -884,7 +884,7 @@ tor_tls_cert_is_valid(int severity, EVP_PKEY *cert_key; int r, key_ok = 0; - if (!signing_cert) + if (!signing_cert || !cert) goto bad; EVP_PKEY *signing_key = X509_get_pubkey(signing_cert->cert); -- cgit v1.2.3-54-g00ecf