mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 08:46:08 +00:00
Merge pull request #7530 from ton31337/fix/safeguard_path->attr
bgpd: Make sure path->attr is not NULL before dereferencing
This commit is contained in:
commit
92395aa0b7
@ -268,7 +268,7 @@ void route_vty_out_flowspec(struct vty *vty, const struct prefix *p,
|
|||||||
json_object *json_ecom_path = NULL;
|
json_object *json_ecom_path = NULL;
|
||||||
json_object *json_time_path = NULL;
|
json_object *json_time_path = NULL;
|
||||||
char timebuf[BGP_UPTIME_LEN];
|
char timebuf[BGP_UPTIME_LEN];
|
||||||
struct ecommunity *ipv6_ecomm;
|
struct ecommunity *ipv6_ecomm = NULL;
|
||||||
|
|
||||||
if (p == NULL || p->family != AF_FLOWSPEC)
|
if (p == NULL || p->family != AF_FLOWSPEC)
|
||||||
return;
|
return;
|
||||||
@ -300,7 +300,9 @@ void route_vty_out_flowspec(struct vty *vty, const struct prefix *p,
|
|||||||
if (!path)
|
if (!path)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ipv6_ecomm = bgp_attr_get_ipv6_ecommunity(path->attr);
|
if (path->attr)
|
||||||
|
ipv6_ecomm = bgp_attr_get_ipv6_ecommunity(path->attr);
|
||||||
|
|
||||||
if (path->attr && (path->attr->ecommunity || ipv6_ecomm)) {
|
if (path->attr && (path->attr->ecommunity || ipv6_ecomm)) {
|
||||||
/* Print attribute */
|
/* Print attribute */
|
||||||
attr = path->attr;
|
attr = path->attr;
|
||||||
|
Loading…
Reference in New Issue
Block a user