From 68a4422da46b86ecf99eb4ebb09ad6e4d66c0fa2 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 24 Oct 2019 18:44:48 -0400 Subject: [PATCH] lib: vrf lookup may be NULL The vrf lookup may be NULL, so let's protect against this. Found in coverity Signed-off-by: Donald Sharp --- lib/if.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/if.c b/lib/if.c index c704ea9bc9b3..594961d763ce 100644 --- a/lib/if.c +++ b/lib/if.c @@ -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; } /*