From ea305b2190382045b2e6f7c5b5742a12cb15f08f Mon Sep 17 00:00:00 2001 From: "John J. Rushford" Date: Wed, 28 Apr 2021 07:06:33 -0600 Subject: [PATCH] Fixes Issue #7739 - Next hop strategy with bad 'to' URL causes TS crash. (#7749) --- proxy/http/remap/NextHopConsistentHash.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/proxy/http/remap/NextHopConsistentHash.cc b/proxy/http/remap/NextHopConsistentHash.cc index be47d6d5f05..c079a8d2f2b 100644 --- a/proxy/http/remap/NextHopConsistentHash.cc +++ b/proxy/http/remap/NextHopConsistentHash.cc @@ -320,8 +320,10 @@ NextHopConsistentHash::findNextHop(TSHttpTxn txnp, void *ih, time_t now) } switch (ring_mode) { case NH_ALTERNATE_RING: - if (groups > 0) { + if (pRec && groups > 0) { cur_ring = (pRec->group_index + 1) % groups; + } else { + cur_ring = 0; } break; case NH_EXHAUST_RING: