From 2eab13249cfea60f5788ac4393d2096e63d19e22 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Fri, 19 Oct 2018 15:55:12 -0300 Subject: [PATCH] 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 --- bgpd/rfapi/vnc_zebra.c | 2 ++ 1 file changed, 2 insertions(+) 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)) { -- 2.39.5