From 75c59b2ed951ade8f50259472b4332817410829c Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Thu, 8 Aug 2013 00:08:02 -0600 Subject: [PATCH] Fix configure parsing IP/domain directives Squid would semi-silently accept invalid IP address or hostname in some directives which required them (eg wccp_router) and use the magic IP_ANYADDR value. This change makes configure halt with a FATAL error instead. Detected by Coverity Scan. Issue 1057286. --- src/cache_cf.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 3774f86d12..7012f53fd0 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1380,8 +1380,12 @@ parse_address(Ip::Address *addr) addr->setNoAddr(); else if ( (*addr = token) ) // try parse numeric/IPA (void) 0; - else - addr->GetHostByName(token); // dont use ipcache + else if (addr->GetHostByName(token)) // dont use ipcache + (void) 0; + else { // not an IP and not a hostname + debugs(3, DBG_CRITICAL, "FATAL: invalid IP address or domain name '" << token << "'"); + self_destruct(); + } } static void -- 2.47.2