summaryrefslogtreecommitdiff
path: root/staticd/static_nb_config.c
diff options
context:
space:
mode:
authorDonald Sharp <donaldsharp72@gmail.com>2023-09-20 12:04:05 -0400
committerGitHub <noreply@github.com>2023-09-20 12:04:05 -0400
commit0c9aabe76040dff04c76b127f92087236a623451 (patch)
treed8c5ba894d3da486b3e5e17937b2a3bd5d024976 /staticd/static_nb_config.c
parentfe1da43cab14bddb91d2a5f9d2c7da2b224f6d17 (diff)
parenta914bd1643fb95fa82b884d3e719b129bc4665e7 (diff)
Merge pull request #14452 from opensourcerouting/fix/coverity_issues
Some recent coverity fixes
Diffstat (limited to 'staticd/static_nb_config.c')
-rw-r--r--staticd/static_nb_config.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/staticd/static_nb_config.c b/staticd/static_nb_config.c
index 6673cce108..520a3ee2c1 100644
--- a/staticd/static_nb_config.c
+++ b/staticd/static_nb_config.c
@@ -382,6 +382,13 @@ static int static_nexthop_bh_type_modify(struct nb_cb_modify_args *args)
nh_vrf = yang_dnode_get_string(args->dnode, "../vrf");
if (nh_ifname && nh_vrf) {
struct vrf *vrf = vrf_lookup_by_name(nh_vrf);
+
+ if (!vrf) {
+ snprintf(args->errmsg, args->errmsg_len,
+ "nexthop vrf %s not found", nh_vrf);
+ return NB_ERR_VALIDATION;
+ }
+
struct interface *ifp = if_lookup_by_name(nh_ifname,
vrf->vrf_id);