summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpaul <paul>2006-10-15 23:41:16 +0000
committerpaul <paul>2006-10-15 23:41:16 +0000
commit83a94f0c271b4fe1f705eb771c3a578798b29b63 (patch)
treee7ab1c82b29206a8b1f263e5489d75671fb0946d
parentba0d790ab4b423792d8e1101c3e28d44a3288115 (diff)
downloadquagga-83a94f0c271b4fe1f705eb771c3a578798b29b63.tar.bz2
quagga-83a94f0c271b4fe1f705eb771c3a578798b29b63.tar.xz
[bgpd] CID#73, potential crash in bgp statistics if called for AFI/SAFI with emtpy table
2006-10-15 Paul Jakma <paul.jakma@sun.com> * bgp_route.c: (bgp_table_stats_walker) NULL deref if table is empty, bgp_table_top may return NULL, Coverity CID#73.
-rw-r--r--bgpd/ChangeLog5
-rw-r--r--bgpd/bgp_route.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/bgpd/ChangeLog b/bgpd/ChangeLog
index c33562da..56107329 100644
--- a/bgpd/ChangeLog
+++ b/bgpd/ChangeLog
@@ -1,3 +1,8 @@
+2006-10-15 Paul Jakma <paul.jakma@sun.com>
+
+ * bgp_route.c: (bgp_table_stats_walker) NULL deref if table is
+ empty, bgp_table_top may return NULL, Coverity CID#73.
+
2006-10-14 Paul Jakma <paul.jakma@sun.com>
* bgp_fsm.h: Remove BGP_EVENT_FLUSH_ADD, dangerous and not
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)
{