Skip to content

Commit

Permalink
Merge pull request FRRouting#14894 from louis-6wind/bestpath-heap
Browse files Browse the repository at this point in the history
bgpd: fix bgp_best_selection heap-use-after-free
  • Loading branch information
ton31337 authored Nov 29, 2023
2 parents fc8a074 + 9561f96 commit e6e846d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -2824,18 +2824,18 @@ void bgp_best_selection(struct bgp *bgp, struct bgp_dest *dest,
/* reap REMOVED routes, if needs be
* selected route must stay for a while longer though
*/
if (CHECK_FLAG(pi->flags, BGP_PATH_REMOVED) &&
(pi != old_select)) {
dest = bgp_path_info_reap(dest, pi);
assert(dest);
}

if (debug)
zlog_debug(
"%s: %pBD(%s) pi from %s in holddown",
__func__, dest, bgp->name_pretty,
pi->peer->host);

if (CHECK_FLAG(pi->flags, BGP_PATH_REMOVED) &&
(pi != old_select)) {
dest = bgp_path_info_reap(dest, pi);
assert(dest);
}

continue;
}

Expand Down

0 comments on commit e6e846d

Please sign in to comment.