--------------------- PatchSet 6171 Date: 2007/11/22 20:06:20 Author: rmartinez Branch: squid3-ipv6 Tag: (none) Log: A very hard hack to detect. Copy constructor cannot accept *NULL contents. This caused Squid to die some times when exploring MIB tree, specially when no service was attended at least one time. because the client table had no clients emacs snmp_core.cc! hence NULL Members: src/snmp_core.cc:1.10.8.32->1.10.8.33 Index: squid3/src/snmp_core.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/snmp_core.cc,v retrieving revision 1.10.8.32 retrieving revision 1.10.8.33 diff -u -r1.10.8.32 -r1.10.8.33 --- squid3/src/snmp_core.cc 22 Nov 2007 17:21:58 -0000 1.10.8.32 +++ squid3/src/snmp_core.cc 22 Nov 2007 20:06:20 -0000 1.10.8.33 @@ -1,6 +1,6 @@ /* - * $Id: snmp_core.cc,v 1.10.8.32 2007/11/22 17:21:58 rmartinez Exp $ + * $Id: snmp_core.cc,v 1.10.8.33 2007/11/22 20:06:20 rmartinez Exp $ * * DEBUG: section 49 SNMP support * AUTHOR: Glenn Chisholm @@ -914,17 +914,23 @@ { oid *instance = NULL; IPAddress laddr; + IPAddress *aux; if (*len <= current->len) { - laddr = *client_entry(NULL); // the first client on db. + aux = client_entry(NULL); + // FIXME INET6 . is this good C++ style ? + // What otherwise ? + if (aux) laddr = *aux ; else laddr.SetAnyAddr(); + #if USE_IPV6 int size = laddr.IsIPv4()? sizeof(in_addr) : sizeof(in6_addr) ; #else int size = sizeof(in_addr); #endif + instance = (oid *)xmalloc(sizeof(name) * (*len + size )); xmemcpy(instance, name, (sizeof(name) * (*len))); - + if ( !laddr.IsAnyAddr() ) { addr2oid(laddr, &instance[ *len]); // the addr *len += size ; @@ -932,7 +938,11 @@ } else { int shift = *len - current->len ; // i.e 4 or 16 oid2addr(&name[*len - shift], laddr,shift); - laddr = *client_entry(&laddr); + aux = client_entry(&laddr); + // FIXME INET6 . is this good C++ style ? + // What otherwise ? + if (aux) laddr = *aux ; else laddr.SetAnyAddr(); + if (!laddr.IsAnyAddr()) { #if USE_IPV6