From 58085f2f6757e464196b283cc8335ab5cf34a012 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Thu, 14 Feb 2019 14:58:40 +0000 Subject: FIB: pass a copy the walk context since it can realloc when new ctx are added. If not we can get some nasty memory corruption. Change-Id: I617709c3013acbcb8aee07dc147894f0de896555 Signed-off-by: Neale Ranns --- src/vnet/fib/fib_walk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vnet/fib/fib_walk.c b/src/vnet/fib/fib_walk.c index 64c2527b7b6..a2674562b3b 100644 --- a/src/vnet/fib/fib_walk.c +++ b/src/vnet/fib/fib_walk.c @@ -363,7 +363,9 @@ fib_walk_advance (fib_node_index_t fwi) while (ii < n_ctxs) { - wrc = fib_node_back_walk_one(&sibling, &fwalk->fw_ctx[ii]); + fib_node_back_walk_ctx_t ctx = fwalk->fw_ctx[ii]; + + wrc = fib_node_back_walk_one(&sibling, &ctx); ii++; fwalk = fib_walk_get(fwi); -- cgit 1.2.3-korg