From: Quentin Young Date: Mon, 5 Aug 2019 16:24:45 +0000 (+0000) Subject: vrrpd: eliminate potential null deref X-Git-Tag: base_7.2~86^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=c257cce4d6d0fe5b9bbb4d4af761c35aeb201b32;p=mirror%2Ffrr.git vrrpd: eliminate potential null deref Signed-off-by: Quentin Young --- diff --git a/vrrpd/vrrp.c b/vrrpd/vrrp.c index da039f7a07..951ad3f58f 100644 --- a/vrrpd/vrrp.c +++ b/vrrpd/vrrp.c @@ -196,14 +196,14 @@ static struct vrrp_vrouter *vrrp_lookup_by_if_mvl(struct interface *mvl_ifp) { struct interface *p; - if (!mvl_ifp || !mvl_ifp->link_ifindex + if (!mvl_ifp || mvl_ifp->link_ifindex == 0 || !vrrp_ifp_has_vrrp_mac(mvl_ifp)) { - if (!mvl_ifp->link_ifindex) + if (mvl_ifp && mvl_ifp->link_ifindex == 0) DEBUGD(&vrrp_dbg_zebra, VRRP_LOGPFX "Interface %s has no parent ifindex; disregarding", mvl_ifp->name); - if (!vrrp_ifp_has_vrrp_mac(mvl_ifp)) + if (mvl_ifp && !vrrp_ifp_has_vrrp_mac(mvl_ifp)) DEBUGD(&vrrp_dbg_zebra, VRRP_LOGPFX "Interface %s has a non-VRRP MAC; disregarding",