From 53d9f67a18dc59fd688fce999cb35653010a54fb Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Sun, 15 Oct 2006 23:41:16 +0000 Subject: [bgpd] CID#73, potential crash in bgp statistics if called for AFI/SAFI with emtpy table 2006-10-15 Paul Jakma * bgp_route.c: (bgp_table_stats_walker) NULL deref if table is empty, bgp_table_top may return NULL, Coverity CID#73. --- bgpd/bgp_route.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bgpd/bgp_route.c') diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index cd28b4df..7b369748 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -8481,7 +8481,8 @@ bgp_table_stats_walker (struct thread *t) struct bgp_table_stats *ts = THREAD_ARG (t); unsigned int space = 0; - top = bgp_table_top (ts->table); + if (!(top = bgp_table_top (ts->table))) + return 0; switch (top->p.family) { -- cgit v1.2.1