From: serassio <> Date: Wed, 31 Aug 2005 02:44:00 +0000 (+0000) Subject: Bug #1317: SNMP GETNEXT fails if the given OID is outside the Squid MIB X-Git-Tag: SQUID_3_0_PRE4~660 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aa6d85ce21858ed0ac9dae2b8d6fed6f5519bc31;p=thirdparty%2Fsquid.git Bug #1317: SNMP GETNEXT fails if the given OID is outside the Squid MIB This quick patch fixes the SNMP GETNEXT search when given an OID outside the Squid MIB. This allows proper integration of Squid into proxy SNMP agents. Forward port of 2.5 patch. --- diff --git a/src/snmp_core.cc b/src/snmp_core.cc index ce951aee15..2237321078 100644 --- a/src/snmp_core.cc +++ b/src/snmp_core.cc @@ -1,6 +1,6 @@ /* - * $Id: snmp_core.cc,v 1.68 2005/06/09 16:04:30 serassio Exp $ + * $Id: snmp_core.cc,v 1.69 2005/08/30 20:44:00 serassio Exp $ * * DEBUG: section 49 SNMP support * AUTHOR: Glenn Chisholm @@ -721,7 +721,13 @@ snmpTreeNext(oid * Current, snint CurrentLen, oid ** Next, snint * NextLen) count++; while ((mibTreeEntry) && (count < CurrentLen) && (!mibTreeEntry->parsefunction)) { - mibTreeEntry = snmpTreeEntry(Current[count], count, mibTreeEntry); + mib_tree_entry *nextmibTreeEntry = snmpTreeEntry(Current[count], count, mibTreeEntry); + + if (!nextmibTreeEntry) + break; + else + mibTreeEntry = nextmibTreeEntry; + count++; }