]> git.proxmox.com Git - mirror_frr.git/commitdiff
spf6d: fix use after free (2) (Coverity 1221459)
authorpaco <paco@voltanet.io>
Wed, 20 Jun 2018 16:09:35 +0000 (18:09 +0200)
committerpaco <paco@voltanet.io>
Thu, 21 Jun 2018 13:18:13 +0000 (15:18 +0200)
Previous fix was incomplete, as calling ospf6_lsa_unlock() frees 'req' but
it does not put it to zero, so it was called ospf6_lsdb_remove() afterwards
even being 'req' already freed.

Signed-off-by: F. Aragon <paco@voltanet.io>
ospf6d/ospf6_flood.c

index 2059d8486829c099daf136c1b853df2d8e418fc0..ae26668c8ae8c199230459dd29818fcb20234726 100644 (file)
@@ -347,6 +347,7 @@ void ospf6_flood_interface(struct ospf6_neighbor *from, struct ospf6_lsa *lsa,
                                                        "Received is newer, remove requesting");
                                        if (req == on->last_ls_req) {
                                                ospf6_lsa_unlock(req);
+                                               req = NULL;
                                                on->last_ls_req = NULL;
                                        }
                                        if (req)