From cb2b6e0494e685fc4cce52a1d449ffd69bec351e Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Thu, 10 Oct 2019 14:01:16 +0200 Subject: [PATCH] Nest: Fix recursive route update Missing cleanup can lead to dangling pointer to old next hops. --- nest/rt-table.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nest/rt-table.c b/nest/rt-table.c index b55bcd40..97a5d1bc 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -2109,9 +2109,10 @@ no_nexthop: else { nhr = nhp; - nhp = (nhp ? (nhp->next = lp_allocz(rte_update_pool, NEXTHOP_MAX_SIZE)) : &(a->nh)); + nhp = (nhp ? (nhp->next = lp_alloc(rte_update_pool, NEXTHOP_MAX_SIZE)) : &(a->nh)); } + memset(nhp, 0, NEXTHOP_MAX_SIZE); nhp->iface = nh->iface; nhp->weight = nh->weight; if (mls)