]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: fix use after free on RIB processing
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Mon, 16 Jan 2023 20:40:54 +0000 (17:40 -0300)
committerRafael Zalamena <rzalamena@opensourcerouting.org>
Mon, 16 Jan 2023 20:40:54 +0000 (17:40 -0300)
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 <rzalamena@opensourcerouting.org>
zebra/zebra_rib.c

index 9551f26d8009ce56c25daf01f0cd4dc792e5840f..fcffb500e9042eee637efd3abb0d8f3980b417c9 100644 (file)
@@ -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);