mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-22 05:58:55 +00:00
pbrd: Prevent possible NULL use
the pnhi data structure can receive either a interface or a nhr data structure. Ensure that we don't crash. CID -> 1500586 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
5c8ecf6e46
commit
920bb6f76a
@ -770,6 +770,7 @@ pbr_nht_individual_nexthop_gw_update(struct pbr_nexthop_cache *pnhc,
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (pnhi->nhr) {
|
||||
switch (pnhi->nhr->prefix.family) {
|
||||
case AF_INET:
|
||||
if (pnhc->nexthop.gate.ipv4.s_addr
|
||||
@ -783,6 +784,7 @@ pbr_nht_individual_nexthop_gw_update(struct pbr_nexthop_cache *pnhc,
|
||||
goto done; /* Unrelated change */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pnhi->nhr_matched = true;
|
||||
if (!pnhi->nhr->nexthop_num) {
|
||||
|
Loading…
Reference in New Issue
Block a user