From: Amos Jeffries Date: Sat, 3 Aug 2013 07:57:44 +0000 (+1200) Subject: Fix configure parsing IP/domain directives X-Git-Tag: SQUID_3_5_0_1~669 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36a8379071ea42b59c418f3b4d0c0a4756c328c4;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 885008db17..ff6c358da7 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1381,8 +1381,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