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 2019/11/14 08:36:55 UTC

[trafficserver] branch 8.0.x updated: Fixes a segfault that may occur when the debug and a lookup fails to find an entry in the hoststatus hash table.

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

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


The following commit(s) were added to refs/heads/8.0.x by this push:
     new 37c74b4  Fixes a segfault that may occur when the debug and a lookup fails to find an entry in the hoststatus hash table.
37c74b4 is described below

commit 37c74b4ea3124a104253ba2f0336ec82e921792c
Author: John Rushford <jr...@apache.org>
AuthorDate: Fri Sep 7 14:43:42 2018 +0000

    Fixes a segfault that may occur when the debug and a lookup fails
    to find an entry in the hoststatus hash table.
    
    (cherry picked from commit 05dd0fdfb223d21b9a54236ba5fb7ab2a0e04050)
---
 src/traffic_server/HostStatus.cc | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/traffic_server/HostStatus.cc b/src/traffic_server/HostStatus.cc
index e210ee5..a187978 100644
--- a/src/traffic_server/HostStatus.cc
+++ b/src/traffic_server/HostStatus.cc
@@ -134,15 +134,14 @@ HostStatus::setHostStatus(const char *name, HostStatus_t status, const unsigned
 HostStatus_t
 HostStatus::getHostStatus(const char *name)
 {
-  HostStatRec_t *_status;
-  int lookup = 0;
-  time_t now = time(0);
+  HostStatRec_t *_status = 0;
+  int lookup             = 0;
+  time_t now             = time(0);
 
   // the hash table value pointer has the HostStatus_t value.
   ink_rwlock_rdlock(&host_status_rwlock);
   lookup = ink_hash_table_lookup(hosts_statuses, name, reinterpret_cast<void **>(&_status));
   ink_rwlock_unlock(&host_status_rwlock);
-  Debug("host_statuses", "name: %s, status: %d", name, static_cast<int>(_status->status));
 
   // if the host was marked down and it's down_time has elapsed, mark it up.
   if (lookup == 1 && _status->status == HostStatus_t::HOST_STATUS_DOWN && _status->down_time > 0) {