mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-09 09:47:11 +00:00
staticd: Check against NULL before dereferencing vrf
If VRF is not found by the given name, validate it and return an error.
Fixes: 76b2bc97e7
("staticd: Accept full blackhole typed keywords for ip_route_cmd")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
parent
cbbdcee7a8
commit
a914bd1643
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user