You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2020/07/13 22:19:27 UTC

[trafficserver] branch 9.0.x updated: Adds null check (#6994)

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

zwoop pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 54b980f  Adds null check (#6994)
54b980f is described below

commit 54b980fd6d4678b353ec010cedc5130d4b3dabba
Author: Randall Meyer <rr...@apache.org>
AuthorDate: Fri Jul 10 12:31:49 2020 -0700

    Adds null check (#6994)
    
    This attempts to fix null pointer access introduced in 3ffd8acf0b5f3f6258270d8ffea1c28d9f412d9c
    
    (cherry picked from commit cd7d9ff274deb28c7c8c4cc0fafc78f4de18e41f)
---
 proxy/http/HttpSM.cc | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index c6a37e5..5aead6d 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -1809,10 +1809,13 @@ HttpSM::state_http_server_open(int event, void *data)
   case VC_EVENT_ACTIVE_TIMEOUT:
   case VC_EVENT_ERROR:
   case NET_EVENT_OPEN_FAILED: {
-    NetVConnection *vc = server_session->get_netvc();
-    if (vc) {
-      server_connection_provided_cert = vc->provided_cert();
+    if (server_session) {
+      NetVConnection *vc = server_session->get_netvc();
+      if (vc) {
+        server_connection_provided_cert = vc->provided_cert();
+      }
     }
+
     t_state.current.state = HttpTransact::CONNECTION_ERROR;
     // save the errno from the connect fail for future use (passed as negative value, flip back)
     t_state.current.server->set_connect_fail(event == NET_EVENT_OPEN_FAILED ? -reinterpret_cast<intptr_t>(data) : ECONNABORTED);