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

[trafficserver] branch master updated: Adds null check (#6994)

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

rrm 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 cd7d9ff  Adds null check (#6994)
cd7d9ff is described below

commit cd7d9ff274deb28c7c8c4cc0fafc78f4de18e41f
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
---
 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 ff3937b..143527a 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -1856,10 +1856,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);