summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhasso <hasso>2005-03-27 13:32:25 +0000
committerhasso <hasso>2005-03-27 13:32:25 +0000
commit1b63904721aa6ca1aabafe23bcf28c5a2ceb2cd8 (patch)
tree9a13bfd8caeb9c92f79ec1ecc3666c66da24a2a8
parent1969e4b9631288979f5f7df6dcaddb86ab32950e (diff)
* ospf_snmp.c: Don't crash in snmp query if ospf instance doesn't
exist at all. [backport candidate]
-rw-r--r--ospfd/ChangeLog5
-rw-r--r--ospfd/ospf_snmp.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/ospfd/ChangeLog b/ospfd/ChangeLog
index 720826d3..f25e7c8a 100644
--- a/ospfd/ChangeLog
+++ b/ospfd/ChangeLog
@@ -1,3 +1,8 @@
+2005-03-27 Hasso Tepper <hasso at quagga.net>
+
+ * ospf_snmp.c: Don't crash in snmp query if ospf instance doesn't
+ exist at all.
+
2005-03-25 Hasso Tepper <hasso at quagga.net>
* ospfd.h: Include log.h, fixes compile with gcc-4.0.
diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c
index 0cf257da..c1994ab4 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)