]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
BUGFIX: potential coredump condition on snmpwalk of empty tables.
authorhno <>
Thu, 30 Aug 2001 15:51:40 +0000 (15:51 +0000)
committerhno <>
Thu, 30 Aug 2001 15:51:40 +0000 (15:51 +0000)
If the indexing function did not return a new OID, make sure the
parsing function is forgotten as well.

src/snmp_core.cc

index cdc880dec74f2558d2c99720c37b000ababe6d29..edf6076e634b8c2c021f7e380da6db44a350384e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: snmp_core.cc,v 1.50 2001/05/27 23:37:51 hno Exp $
+ * $Id: snmp_core.cc,v 1.51 2001/08/30 09:51:40 hno Exp $
  *
  * DEBUG: section 49    SNMP support
  * AUTHOR: Glenn Chisholm
@@ -729,7 +729,10 @@ snmpTreeNext(oid * Current, snint CurrentLen, oid ** Next, snint * NextLen)
        *NextLen = mibTreeEntry->len;
        *Next = (*mibTreeEntry->instancefunction) (mibTreeEntry->name, NextLen, mibTreeEntry, &Fn);
     }
-    return (Fn);
+    if (*Next)
+       return (Fn);
+    else
+       return NULL;
 }
 
 static oid *