From: Renato Westphal Date: Fri, 19 Oct 2018 18:55:12 +0000 (-0300) Subject: bgpd: fix bug while iterating over VPN table X-Git-Tag: frr-7.1-dev~253^2~4 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=2eab13249cfea60f5788ac4393d2096e63d19e22;p=matthieu%2Ffrr.git bgpd: fix bug while iterating over VPN table 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 --- diff --git a/bgpd/rfapi/vnc_zebra.c b/bgpd/rfapi/vnc_zebra.c index a57f908f62..158c88da16 100644 --- a/bgpd/rfapi/vnc_zebra.c +++ b/bgpd/rfapi/vnc_zebra.c @@ -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)) {