]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: fix bug while iterating over VPN table
authorRenato Westphal <renato@opensourcerouting.org>
Fri, 19 Oct 2018 18:55:12 +0000 (15:55 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Mon, 17 Dec 2018 14:14:05 +0000 (12:14 -0200)
The routing table data structure can create intermediate route nodes
during its normal operation, so we always need to check if the 'info'
pointer of a route node is NULL or not before dereferencing it.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
bgpd/rfapi/vnc_zebra.c

index a2871188e69b32b852f3868fe6ca80b1fbebe96e..a982f288290212e862abfaea10b06465c8f66074 100644 (file)
@@ -313,6 +313,8 @@ static void vnc_redistribute_withdraw(struct bgp *bgp, afi_t afi, uint8_t type)
 
                /* This is the per-RD table of prefixes */
                table = prn->info;
+               if (!table)
+                       continue;
 
                for (rn = bgp_table_top(table); rn; rn = bgp_route_next(rn)) {