mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-27 13:06:51 +00:00
Merge pull request #7330 from donaldsharp/zebra_use_after_free
zebra: Fix use after free in debug path
This commit is contained in:
commit
f41688b423
@ -2268,9 +2268,18 @@ static void process_subq_route(struct listnode *lnode, uint8_t qindex)
|
|||||||
rib_process(rnode);
|
rib_process(rnode);
|
||||||
|
|
||||||
if (IS_ZEBRA_DEBUG_RIB_DETAILED) {
|
if (IS_ZEBRA_DEBUG_RIB_DETAILED) {
|
||||||
struct route_entry *re = re_list_first(&dest->routes);
|
struct route_entry *re = NULL;
|
||||||
char buf[SRCDEST2STR_BUFFER];
|
char buf[SRCDEST2STR_BUFFER];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* rib_process may have freed the dest
|
||||||
|
* as part of the garbage collection. Let's
|
||||||
|
* prevent stupidity from happening.
|
||||||
|
*/
|
||||||
|
dest = rib_dest_from_rnode(rnode);
|
||||||
|
if (dest)
|
||||||
|
re = re_list_first(&dest->routes);
|
||||||
|
|
||||||
srcdest_rnode2str(rnode, buf, sizeof(buf));
|
srcdest_rnode2str(rnode, buf, sizeof(buf));
|
||||||
zlog_debug("%s(%u:%u):%s: rn %p dequeued from sub-queue %u",
|
zlog_debug("%s(%u:%u):%s: rn %p dequeued from sub-queue %u",
|
||||||
zvrf_name(zvrf), zvrf_id(zvrf), re ? re->table : 0, buf,
|
zvrf_name(zvrf), zvrf_id(zvrf), re ? re->table : 0, buf,
|
||||||
|
Loading…
Reference in New Issue
Block a user