summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Jakma <paul.jakma@sun.com>2006-05-12 22:50:40 +0000
committerPaul Jakma <paul.jakma@sun.com>2006-05-12 22:50:40 +0000
commit894f8b6602f786db42da58c48b1338df5fa98732 (patch)
tree27d1cdb69d21e33a641c108a0ce39fd480e748f7
parent1a8ec2b9a3557e4f6ad3c8780b72b35be6d86a3e (diff)
[ospfd] CID #49, fix dereference before NULL check
2006-05-11 Paul Jakma <paul.jakma@sun.com> * ospf_route.c: (ospf_route_delete_same_ext) Fix deref before NULL check by moving into check-protected block, fix CID #49.
-rw-r--r--ospfd/ChangeLog2
-rw-r--r--ospfd/ospf_route.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/ospfd/ChangeLog b/ospfd/ChangeLog
index 6cb83f9a..a66cfa06 100644
--- a/ospfd/ChangeLog
+++ b/ospfd/ChangeLog
@@ -6,6 +6,8 @@
result, fixes Coverity CID #70.
(no_ospf_area_filter_list) Check NULL result from
ospf_area_lookup_by_area_id, fixes Coverity CID #69
+ * ospf_route.c: (ospf_route_delete_same_ext) Fix deref before
+ NULL check by moving into check-protected block, fix CID #49.
2006-04-24 Paul Jakma <paul.jakma@sun.com>
diff --git a/ospfd/ospf_route.c b/ospfd/ospf_route.c
index 646b625f..e0f2565f 100644
--- a/ospfd/ospf_route.c
+++ b/ospfd/ospf_route.c
@@ -195,9 +195,9 @@ ospf_route_delete_same_ext(struct route_table *external_routes,
struct prefix_ipv4 *p = (struct prefix_ipv4 *)(&rn->p);
if ( (ext_rn = route_node_lookup (external_routes, (struct prefix *)p)) )
{
- ospf_zebra_delete (p, ext_rn->info);
if (ext_rn->info)
{
+ ospf_zebra_delete (p, ext_rn->info);
ospf_route_free( ext_rn->info);
ext_rn->info = NULL;
}