]> git.puffer.fish Git - mirror/frr.git/commitdiff
vrrpd: eliminate potential null deref 4777/head
authorQuentin Young <qlyoung@cumulusnetworks.com>
Mon, 5 Aug 2019 16:24:45 +0000 (16:24 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Mon, 5 Aug 2019 16:24:45 +0000 (16:24 +0000)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
vrrpd/vrrp.c

index da039f7a07c9e07fc37926ecd74e6e33131aefd4..951ad3f58fbeda76411315a5dd15b7174326bb06 100644 (file)
@@ -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",