From 68cecc3b69af13cda334e5bf0acb60d01e9f7ddc Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 30 Apr 2020 11:16:28 -0400 Subject: [PATCH] bgpd: Ensure that we have a ifp pointer It is possible that the if_lookup_by_index() call will return a NULL value and calling zclient_send_interface_radv_req. Just test that we have a valid interface pointer. Found by Coverity Signed-off-by: Donald Sharp --- bgpd/bgp_nht.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c index cc208a8190..fced2fbcab 100644 --- a/bgpd/bgp_nht.c +++ b/bgpd/bgp_nht.c @@ -962,6 +962,9 @@ void bgp_nht_dereg_enhe_cap_intfs(struct peer *peer) for (nhop = bnc->nexthop; nhop; nhop = nhop->next) { ifp = if_lookup_by_index(nhop->ifindex, nhop->vrf_id); + if (!ifp) + continue; + zclient_send_interface_radv_req(zclient, nhop->vrf_id, ifp, 0, 0); } -- 2.39.5