summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2014-02-06 17:54:25 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2014-02-06 17:54:25 +0100
commit10c2e1e0125dfa600b1c2b6553883cccf2d025dd (patch)
tree96064c4984ee0599c14c34a2bdf4e8b7cb166416
parentcba9cbf1bdb253c7727da10ff4f835d7ffbadeed (diff)
Fixes crash when state of disabled OSPF protocol is queried.
Thanks to Ondrej Caletka for the bugreport.
-rw-r--r--proto/ospf/ospf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c
index cf520401..e751f7ca 100644
--- a/proto/ospf/ospf.c
+++ b/proto/ospf/ospf.c
@@ -1276,7 +1276,6 @@ ospf_sh_state(struct proto *p, int verbose, int reachable)
{
struct proto_ospf *po = (struct proto_ospf *) p;
struct ospf_lsa_header *cnode = NULL;
- int num = po->gr->hash_entries;
unsigned int i, ix, j1, j2, jx;
u32 last_area = 0xFFFFFFFF;
@@ -1290,6 +1289,7 @@ ospf_sh_state(struct proto *p, int verbose, int reachable)
/* We store interesting area-scoped LSAs in array hea and
global-scoped (LSA_T_EXT) LSAs in array hex */
+ int num = po->gr->hash_entries;
struct top_hash_entry *hea[num];
struct top_hash_entry *hex[verbose ? num : 0];
struct top_hash_entry *he;