Skip to content

Commit

Permalink
pimd: fix possible NULL dereference
Browse files Browse the repository at this point in the history
Coverity scan ID: 1598684

Signed-off-by: Rafael Zalamena <[email protected]>
  • Loading branch information
rzalamena committed Jul 31, 2024
1 parent 3b3fff4 commit d6d49f2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pimd/pim_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2837,13 +2837,14 @@ DEFPY(clear_ip_msdp_peer, clear_ip_msdp_peer_cmd,
const struct vrf *vrf;
struct pim_msdp_peer *mp;

if (vrfname) {
if (vrfname)
vrf = vrf_lookup_by_name(vrfname);
if (vrf == NULL)
return CMD_WARNING;
} else
else
vrf = vrf_lookup_by_id(VRF_DEFAULT);

if (vrf == NULL || vrf->info == NULL)
return CMD_WARNING;

pim = vrf->info;
for (ALL_LIST_ELEMENTS_RO(pim->msdp.peer_list, node, mp)) {
if (mp->peer.s_addr != peer.s_addr)
Expand Down

0 comments on commit d6d49f2

Please sign in to comment.