This is an automated email from the ASF dual-hosted git repository.

paziz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 42e56e9  Coverity 1379271: Dereference null return
42e56e9 is described below

commit 42e56e91a4db2297e849884946e05d6d03e0d50c
Author: Syeda Persia Aziz <persia.a...@yahoo.com>
AuthorDate: Thu Aug 10 23:01:36 2017 -0500

    Coverity 1379271: Dereference null return
---
 iocore/net/SSLUtils.cc | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/iocore/net/SSLUtils.cc b/iocore/net/SSLUtils.cc
index f9d7f16..38a33ab 100644
--- a/iocore/net/SSLUtils.cc
+++ b/iocore/net/SSLUtils.cc
@@ -1626,13 +1626,15 @@ SSLInitServerContext(const SSLConfigParams *params, 
const ssl_user_config *sslMu
         // Now, load any additional certificate chains specified in this entry.
         if (sslMultCertSettings->ca) {
           const char *ca_name = ca_tok.getNext();
-          ats_scoped_str 
completeServerCertChainPath(Layout::relative_to(params->serverCertPathOnly, 
ca_name));
-          if (!SSL_CTX_add_extra_chain_cert_file(ctx, 
completeServerCertChainPath)) {
-            SSLError("failed to load certificate chain from %s", (const char 
*)completeServerCertChainPath);
-            goto fail;
-          }
-          if (SSLConfigParams::load_ssl_file_cb) {
-            SSLConfigParams::load_ssl_file_cb(completeServerCertChainPath, 
CONFIG_FLAG_UNVERSIONED);
+          if (ca_name != nullptr) {
+            ats_scoped_str 
completeServerCertChainPath(Layout::relative_to(params->serverCertPathOnly, 
ca_name));
+            if (!SSL_CTX_add_extra_chain_cert_file(ctx, 
completeServerCertChainPath)) {
+              SSLError("failed to load certificate chain from %s", (const char 
*)completeServerCertChainPath);
+              goto fail;
+            }
+            if (SSLConfigParams::load_ssl_file_cb) {
+              SSLConfigParams::load_ssl_file_cb(completeServerCertChainPath, 
CONFIG_FLAG_UNVERSIONED);
+            }
           }
         }
       }

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Reply via email to