From 5f140efeeffdd9951456701b78a70a71b879be5a Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 27 Jul 2020 07:10:41 -0400 Subject: [PATCH] bgpd: Deref after null check in bgp_evpn_vty.c Coverity has noticed that we are using bgp_evpn after we have already NULL checked it one time. Add an assert to make Coverity happy here, if we get to this point something terrible has happened. Signed-off-by: Donald Sharp --- bgpd/bgp_evpn_vty.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c index 2cb13fb85f..2584939378 100644 --- a/bgpd/bgp_evpn_vty.c +++ b/bgpd/bgp_evpn_vty.c @@ -3899,6 +3899,12 @@ DEFPY (bgp_evpn_advertise_pip_ip_mac, struct listnode *node = NULL; struct bgpevpn *vpn = NULL; + /* + * At this point if bgp_evpn is NULL and evpn is enabled + * something stupid has gone wrong + */ + assert(bgp_evpn); + update_advertise_vrf_routes(bgp_vrf); /* Update (svi) type-2 routes */ -- 2.39.5