From: Amos Jeffries Date: Tue, 10 Sep 2013 07:34:29 +0000 (-0600) Subject: Fix configure parsing IP/domain directives X-Git-Tag: SQUID_3_3_10~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40919b6eac3cd2b110c7ae9c59949ef96f6c66a1;p=thirdparty%2Fsquid.git 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. --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index e624b71b3b..d8bd15923c 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1366,8 +1366,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