--------------------- PatchSet 4886 Date: 2007/06/26 13:15:26 Author: amosjeffries Branch: squid3-ipv6 Tag: (none) Log: Fix small logic error in CNAME processing. Members: src/ipcache.cc:1.9.2.33->1.9.2.34 Index: squid3/src/ipcache.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ipcache.cc,v retrieving revision 1.9.2.33 retrieving revision 1.9.2.34 diff -u -r1.9.2.33 -r1.9.2.34 --- squid3/src/ipcache.cc 26 Jun 2007 13:03:28 -0000 1.9.2.33 +++ squid3/src/ipcache.cc 26 Jun 2007 13:15:26 -0000 1.9.2.34 @@ -1,6 +1,6 @@ /* - * $Id: ipcache.cc,v 1.9.2.33 2007/06/26 13:03:28 amosjeffries Exp $ + * $Id: ipcache.cc,v 1.9.2.34 2007/06/26 13:15:26 amosjeffries Exp $ * * DEBUG: section 14 IP Cache * AUTHOR: Harvest Derived @@ -820,7 +820,7 @@ // copy the old IPs into the new list buffer. tmpbuf = i->addrs.in_addrs; i->addrs.in_addrs = (IPAddress *)xcalloc(fc, sizeof(IPAddress)); - for(int l = 0; j < fc; l++, j++) { + for(int l = 0; j < pcount; l++, j++) { i->addrs.in_addrs[j] = ((IPAddress*)tmpbuf)[l]; debugs(14, 5, "ipcacheHandleCnameRecurse: CNAME (" << pname << ") #" << j << " " << i->addrs.in_addrs[j] ); } @@ -838,7 +838,7 @@ /* add new IP records to entry */ debugs(14, 5, "ipcacheHandleCnameRecurse: Add " << ccount << " IPs from CNAME Lookup."); - for(int l = 0; j < fc; l++, j++) { + for(int l = 0; l < ccount && j < fc; l++, j++) { i->addrs.in_addrs[j] = addrs->in_addrs[l]; debugs(14, 3, "ipcacheHandleCnameRecurse: CNAME (" << pname << ") #" << j << " " << i->addrs.in_addrs[j] ); }