From: hasso Date: Sun, 27 Mar 2005 13:32:25 +0000 (+0000) Subject: * ospf_snmp.c: Don't crash in snmp query if ospf instance doesn't X-Git-Tag: frr-2.0-rc1~3133 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=1b63904721aa6ca1aabafe23bcf28c5a2ceb2cd8;p=mirror%2Ffrr.git * ospf_snmp.c: Don't crash in snmp query if ospf instance doesn't exist at all. [backport candidate] --- diff --git a/ospfd/ChangeLog b/ospfd/ChangeLog index 720826d3b2..f25e7c8a1f 100644 --- a/ospfd/ChangeLog +++ b/ospfd/ChangeLog @@ -1,3 +1,8 @@ +2005-03-27 Hasso Tepper + + * ospf_snmp.c: Don't crash in snmp query if ospf instance doesn't + exist at all. + 2005-03-25 Hasso Tepper * ospfd.h: Include log.h, fixes compile with gcc-4.0. diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c index 0cf257da4d..c1994ab423 100644 --- a/ospfd/ospf_snmp.c +++ b/ospfd/ospf_snmp.c @@ -2130,6 +2130,9 @@ ospfNbrLookup (struct variable *v, oid *name, size_t *length, ospf = ospf_lookup (); + if (! ospf) + return NULL; + if (exact) { if (*length != v->namelen + IN_ADDR_SIZE + 1)