]> git.proxmox.com Git - mirror_frr.git/commitdiff
pimd: fix pim_instance NULL deference in pim_vxlan_mlag_update
authorsarita patra <saritap@vmware.com>
Mon, 4 Apr 2022 10:53:36 +0000 (03:53 -0700)
committersarita patra <saritap@vmware.com>
Mon, 4 Apr 2022 12:27:57 +0000 (05:27 -0700)
Fixing the below coverity issue.
>>>     CID 1515545:    (NULL_RETURNS)
>>>     Dereferencing a pointer that might be "NULL" "pim" when calling "pim_vxlan_set_peerlink_rif".
902                     pim_vxlan_set_peerlink_rif(pim, NULL);

Signed-off-by: sarita patra <saritap@vmware.com>
pimd/pim_vxlan.c

index 5e55b9f9c8860784e38824007e13d8545270701f..e4d969daee9efe42a118aae969bf2e68a25b1b4d 100644 (file)
@@ -880,6 +880,12 @@ void pim_vxlan_mlag_update(bool enable, bool peer_state, uint32_t role,
         */
        pim = pim_get_pim_instance(VRF_DEFAULT);
 
+       if (!pim) {
+               if (PIM_DEBUG_VXLAN)
+                       zlog_debug("%s: Unable to find pim instance", __func__);
+               return;
+       }
+
        if (enable)
                vxlan_mlag.flags |= PIM_VXLAN_MLAGF_ENABLED;
        else