]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fixes crash when state of disabled OSPF protocol is queried.
authorOndrej Zajicek <santiago@crfreenet.org>
Thu, 6 Feb 2014 16:54:25 +0000 (17:54 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Thu, 6 Feb 2014 16:54:25 +0000 (17:54 +0100)
Thanks to Ondrej Caletka for the bugreport.

proto/ospf/ospf.c

index cf520401e4a985e8475f748585ac295cfe5e8713..e751f7ca889af7ee149d217594f659a6419b2440 100644 (file)
@@ -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;