mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 22:37:49 +00:00
Merge pull request #6903 from ton31337/fix/prevent_null_pointer_dereference_for_aspath
bgpd: Reuse bgp_adj_in for attr to avoid null dereference under aspath
This commit is contained in:
commit
0856cc337f
@ -3063,12 +3063,14 @@ static uint32_t bgp_filtered_routes_count(struct peer *peer, afi_t afi,
|
||||
bool filtered = false;
|
||||
struct bgp_dest *dest;
|
||||
struct bgp_adj_in *ain;
|
||||
struct attr attr = {};
|
||||
struct bgp_table *table = peer->bgp->rib[afi][safi];
|
||||
|
||||
for (dest = bgp_table_top(table); dest; dest = bgp_route_next(dest)) {
|
||||
for (ain = dest->adj_in; ain; ain = ain->next) {
|
||||
const struct prefix *rn_p = bgp_dest_get_prefix(dest);
|
||||
struct attr attr = {};
|
||||
|
||||
attr = *ain->attr;
|
||||
|
||||
if (bgp_input_filter(peer, rn_p, &attr, afi, safi)
|
||||
== FILTER_DENY)
|
||||
|
Loading…
Reference in New Issue
Block a user