From: G. Paul Ziemba Date: Sun, 11 Feb 2018 16:13:12 +0000 (-0800) Subject: bgpd: rfapi: avoid null pointer dereference in vnc_export_bgp_disable if rfapi is... X-Git-Tag: frr-5.0-dev~153^2~15 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=b8e031e542a084a97a63bdde7b1e4625e1b69c08;p=matthieu%2Ffrr.git bgpd: rfapi: avoid null pointer dereference in vnc_export_bgp_disable if rfapi is not provisioned Signed-off-by: G. Paul Ziemba --- diff --git a/bgpd/rfapi/vnc_export_bgp.c b/bgpd/rfapi/vnc_export_bgp.c index c4d66bbc65..ae31c3fe9e 100644 --- a/bgpd/rfapi/vnc_export_bgp.c +++ b/bgpd/rfapi/vnc_export_bgp.c @@ -2049,6 +2049,9 @@ void vnc_direct_bgp_rh_reexport(struct bgp *bgp, afi_t afi) */ void vnc_export_bgp_enable(struct bgp *bgp, afi_t afi) { + if (!bgp->rfapi_cfg) + return; + switch (bgp->rfapi_cfg->flags & BGP_VNC_CONFIG_EXPORT_BGP_MODE_BITS) { case BGP_VNC_CONFIG_EXPORT_BGP_MODE_NONE: break; @@ -2069,6 +2072,9 @@ void vnc_export_bgp_enable(struct bgp *bgp, afi_t afi) void vnc_export_bgp_disable(struct bgp *bgp, afi_t afi) { + if (!bgp->rfapi_cfg) + return; + switch (bgp->rfapi_cfg->flags & BGP_VNC_CONFIG_EXPORT_BGP_MODE_BITS) { case BGP_VNC_CONFIG_EXPORT_BGP_MODE_NONE: break;