From e96817f8771164e68bd591d57bdbf819a0286d8d Mon Sep 17 00:00:00 2001 From: Rafael Zalamena Date: Mon, 16 Jan 2023 17:40:54 -0300 Subject: [PATCH] zebra: fix use after free on RIB processing After calling `rib_unlink` the variable `re` will point to `free()`d memory, so don't attempt to use it after this point. Found by Coverity Scan (Coverity ID 1519784) Signed-off-by: Rafael Zalamena --- zebra/zebra_rib.c | 1 + 1 file changed, 1 insertion(+) diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 9551f26d80..fcffb500e9 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -1306,6 +1306,7 @@ static void rib_process(struct route_node *rn) vrf), vrf_id, rn); rib_unlink(rn, re); + continue; } else SET_FLAG(re->status, ROUTE_ENTRY_REMOVED); -- 2.39.5