From: Donald Sharp Date: Thu, 30 Apr 2020 15:16:28 +0000 (-0400) Subject: bgpd: Ensure that we have a ifp pointer X-Git-Tag: base_7.4~15^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=68cecc3b69af13cda334e5bf0acb60d01e9f7ddc;p=matthieu%2Ffrr.git 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 --- 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); }