From: hno <> Date: Thu, 30 Aug 2001 15:51:40 +0000 (+0000) Subject: BUGFIX: potential coredump condition on snmpwalk of empty tables. X-Git-Tag: SQUID_3_0_PRE1~1422 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=96ca8fa177022d9b7ce6e054b5c161a2caefc0a8;p=thirdparty%2Fsquid.git BUGFIX: potential coredump condition on snmpwalk of empty tables. If the indexing function did not return a new OID, make sure the parsing function is forgotten as well. --- diff --git a/src/snmp_core.cc b/src/snmp_core.cc index cdc880dec7..edf6076e63 100644 --- a/src/snmp_core.cc +++ b/src/snmp_core.cc @@ -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 *