summaryrefslogtreecommitdiff
path: root/ospfd
diff options
context:
space:
mode:
authorPaul Jakma <paul.jakma@sun.com>2006-05-12 23:11:14 +0000
committerPaul Jakma <paul.jakma@sun.com>2006-05-12 23:11:14 +0000
commite54e6e57205df19efe3023526b7eb53a9d06fa93 (patch)
treedbe366409aef4f115a1c84998e52d97e9943223c /ospfd
parentdeb1561c1824d0a5215c8fcd0084393090a6567e (diff)
[ospfd] CID #13, debug for NULL type7 LSA should not print out data from it
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.
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ChangeLog6
-rw-r--r--ospfd/ospf_lsa.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/ospfd/ChangeLog b/ospfd/ChangeLog
index c9bdff65..96162b04 100644
--- a/ospfd/ChangeLog
+++ b/ospfd/ChangeLog
@@ -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
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c
index 9ef5a6ae..d2f593e5 100644
--- a/ospfd/ospf_lsa.c
+++ b/ospfd/ospf_lsa.c
@@ -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;
}