]> git.puffer.fish Git - matthieu/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>
Sat, 20 Oct 2018 15:39:05 +0000 (12:39 -0300)
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 a57f908f620c76286bb749e354ba8aecdd22b343..158c88da1670b4f901be8a721937491a0a296a2d 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)) {