mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 21:50:39 +00:00
zebra: handle depends_find() NULL nexthop
SA warned us lookup could be NULL dereferenced in some paths. Handle the case where we are passed a NULL nexthop before we try to copy it. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
This commit is contained in:
parent
ff5d5005a2
commit
606fa9e58d
@ -1000,6 +1000,9 @@ static struct nhg_hash_entry *depends_find(struct nexthop *nh, afi_t afi)
|
|||||||
struct nexthop *lookup = NULL;
|
struct nexthop *lookup = NULL;
|
||||||
struct nhg_hash_entry *nhe = NULL;
|
struct nhg_hash_entry *nhe = NULL;
|
||||||
|
|
||||||
|
if (!nh)
|
||||||
|
goto done;
|
||||||
|
|
||||||
copy_nexthops(&lookup, nh, NULL);
|
copy_nexthops(&lookup, nh, NULL);
|
||||||
|
|
||||||
/* Clear it, in case its a group */
|
/* Clear it, in case its a group */
|
||||||
@ -1012,6 +1015,7 @@ static struct nhg_hash_entry *depends_find(struct nexthop *nh, afi_t afi)
|
|||||||
|
|
||||||
nexthops_free(lookup);
|
nexthops_free(lookup);
|
||||||
|
|
||||||
|
done:
|
||||||
return nhe;
|
return nhe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user