]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Deref after null check in bgp_evpn_vty.c
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 27 Jul 2020 11:10:41 +0000 (07:10 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 27 Jul 2020 11:10:41 +0000 (07:10 -0400)
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 <sharpd@cumulusnetworks.com>
bgpd/bgp_evpn_vty.c

index 2cb13fb85fb1be96922d07477a3d7a20f6654cef..2584939378bbf2a5f8492b8b98f541e1317c4f8b 100644 (file)
@@ -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 */