]> git.puffer.fish Git - mirror/frr.git/commitdiff
[ospfd] CID #13, debug for NULL type7 LSA should not print out data from it
authorPaul Jakma <paul.jakma@sun.com>
Fri, 12 May 2006 23:11:14 +0000 (23:11 +0000)
committerPaul Jakma <paul.jakma@sun.com>
Fri, 12 May 2006 23:11:14 +0000 (23:11 +0000)
2006-05-12 Paul Jakma <paul.jakma@sun.com>

* ospf_lsa.c: (ospf_translated_nssa_refresh) Add non-assert
  sanity check, in case DEBUG isn't defined.  Debug message
  when no type7 exists should print the ID from the type5, not
  the type7, fixes CID #13.

ospfd/ChangeLog
ospfd/ospf_lsa.c

index c9bdff65da618b65fb03435a57667b5c5c2be3bf..96162b0489ee06a0b5ab84997a79e6c0b29e935a 100644 (file)
@@ -5,7 +5,11 @@
          functionality which is never used, hence fixing Coverity CID
          #29.
          (struct lsa_action) remove unused member.
-       * ospf_interface.c: (ospf_if_exists) Fix missing NULL return
+         (ospf_translated_nssa_refresh) Add non-assert sanity check,
+         in case DEBUG isn't defined.
+         Debug message when no type7 exists should print the ID from
+         the type5, not the type7, fixes CID #13.
+       * ospf_interface.c: (ospf_if_exists) Fix missing NULL return
          check on ospf_lookup, CID #27.
        * ospf_asbr.c: (ospf_redistribute_withdraw) remove ospf_lookup
          call by taking the struct ospf * as argument, which the
index 9ef5a6ae6b3085724e5f78eeb8c46f0a517fd6c9..d2f593e516e54c8263fcf72ed97fc0993afbaa9e 100644 (file)
@@ -2002,6 +2002,8 @@ ospf_translated_nssa_refresh (struct ospf *ospf, struct ospf_lsa *type7,
   
   /* Sanity checks. */
   assert (type7 || type5);
+  if (!type7 || !type5)
+    return NULL;
   if (type7)
     assert (type7->data);
   if (type5)
@@ -2055,7 +2057,7 @@ ospf_translated_nssa_refresh (struct ospf *ospf, struct ospf_lsa *type7,
       if (IS_DEBUG_OSPF_NSSA)
         zlog_debug ("ospf_translated_nssa_refresh(): no Type-7 found for "
                    "Type-5 LSA Id %s",
-                   inet_ntoa (type7->data->id));
+                   inet_ntoa (type5->data->id));
       return NULL;
     }