mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 08:56:13 +00:00
Merge pull request #2518 from pacovn/Coverity_23106_Explicit_null_dereferenced
bgpd: null check (Coverity 23106)
This commit is contained in:
commit
277781a778
@ -1632,7 +1632,7 @@ struct aspath *aspath_reconcile_as4(struct aspath *aspath,
|
||||
struct aspath *newpath = NULL, *mergedpath;
|
||||
int hops, cpasns = 0;
|
||||
|
||||
if (!aspath)
|
||||
if (!aspath || !as4path)
|
||||
return NULL;
|
||||
|
||||
seg = aspath->segments;
|
||||
|
@ -1513,6 +1513,9 @@ bgp_attr_munge_as4_attrs(struct peer *const peer, struct attr *const attr,
|
||||
if (!ignore_as4_path
|
||||
&& (attr->flag & (ATTR_FLAG_BIT(BGP_ATTR_AS4_PATH)))) {
|
||||
newpath = aspath_reconcile_as4(attr->aspath, as4_path);
|
||||
if (!newpath)
|
||||
return BGP_ATTR_PARSE_ERROR;
|
||||
|
||||
aspath_unintern(&attr->aspath);
|
||||
attr->aspath = aspath_intern(newpath);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user