------------------------------------------------------------ revno: 12611 revision-id: squid3@treenet.co.nz-20130910073429-v5tpyaaote8w5x0k parent: squid3@treenet.co.nz-20130910073109-6daq6g95rs58jyf4 committer: Amos Jeffries branch nick: 3.3 timestamp: Tue 2013-09-10 01:34:29 -0600 message: 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. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20130910073429-v5tpyaaote8w5x0k # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # testament_sha1: 975429e37bd6147133d7b8c2501b3dae9dcd78e9 # timestamp: 2013-09-10 07:42:08 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # base_revision_id: squid3@treenet.co.nz-20130910073109-\ # 6daq6g95rs58jyf4 # # Begin patch === modified file 'src/cache_cf.cc' --- src/cache_cf.cc 2013-06-30 08:45:09 +0000 +++ src/cache_cf.cc 2013-09-10 07:34:29 +0000 @@ -1366,8 +1366,12 @@ 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