From b8e031e542a084a97a63bdde7b1e4625e1b69c08 Mon Sep 17 00:00:00 2001 From: "G. Paul Ziemba" Date: Sun, 11 Feb 2018 08:13:12 -0800 Subject: [PATCH] bgpd: rfapi: avoid null pointer dereference in vnc_export_bgp_disable if rfapi is not provisioned Signed-off-by: G. Paul Ziemba --- bgpd/rfapi/vnc_export_bgp.c | 6 ++++++ 1 file changed, 6 insertions(+) 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; -- 2.39.5