Skip to content

Commit

Permalink
lib: vrf lookup may be NULL
Browse files Browse the repository at this point in the history
The vrf lookup may be NULL, so let's protect against this.
Found in coverity

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
  • Loading branch information
donaldsharp committed Oct 24, 2019
1 parent f935dca commit 68a4422
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/if.c
Expand Up @@ -1585,7 +1585,7 @@ static const void *lib_interface_lookup_entry(const void *parent_list_entry,
const char *vrfname = keys->key[1];
struct vrf *vrf = vrf_lookup_by_name(vrfname);

return if_lookup_by_name(ifname, vrf->vrf_id);
return vrf ? if_lookup_by_name(ifname, vrf->vrf_id) : NULL;
}

/*
Expand Down

0 comments on commit 68a4422

Please sign in to comment.