From: Eduard Bagdasaryan Date: Tue, 3 Oct 2023 14:40:02 +0000 (+0000) Subject: Fix handling of zero cache_peers (#1499) X-Git-Tag: SQUID_7_0_1~341 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c375465955acd24ca0202f59bec02f0d64694d4b;p=thirdparty%2Fsquid.git Fix handling of zero cache_peers (#1499) The bug was introduced in recent commit 2e24d0b. --- diff --git a/src/neighbors.cc b/src/neighbors.cc index 3cf963b7f4..4b2a8bda3a 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -1502,8 +1502,10 @@ dump_peers(StoreEntry *sentry, CachePeers *peers) char ntoabuf[MAX_IPSTRLEN]; int i; - if (peers == nullptr) + if (!peers) { storeAppendPrintf(sentry, "There are no neighbors installed.\n"); + return; + } for (const auto &peer: *peers) { const auto e = peer.get();