]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1317: SNMP GETNEXT fails if the given OID is outside the Squid MIB
authorserassio <>
Wed, 31 Aug 2005 02:44:00 +0000 (02:44 +0000)
committerserassio <>
Wed, 31 Aug 2005 02:44:00 +0000 (02:44 +0000)
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.

src/snmp_core.cc

index ce951aee15cdad39b976ebf4756dc86bedf54045..223732107831131617c52258005a5fa389dc7416 100644 (file)
@@ -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++;
         }