From 894f8b6602f786db42da58c48b1338df5fa98732 Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Fri, 12 May 2006 22:50:40 +0000 Subject: [ospfd] CID #49, fix dereference before NULL check 2006-05-11 Paul Jakma * ospf_route.c: (ospf_route_delete_same_ext) Fix deref before NULL check by moving into check-protected block, fix CID #49. --- ospfd/ChangeLog | 2 ++ ospfd/ospf_route.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'ospfd') 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 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; } -- cgit v1.2.1