]> git.proxmox.com Git - mirror_frr.git/commitdiff
ripd, ripngd: fix null pointer dereference in YANG RPCs
authorRenato Westphal <renato@opensourcerouting.org>
Fri, 4 Jan 2019 13:55:15 +0000 (11:55 -0200)
committerRenato Westphal <renato@opensourcerouting.org>
Fri, 18 Jan 2019 18:15:41 +0000 (16:15 -0200)
These RPCs should do nothing when RIP/RIPng aren't configured.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
ripd/rip_northbound.c
ripngd/ripng_northbound.c

index 4e445bd46df4bddab4cc14b084d4551a44b99506..49bf90198a21c56885f79f2588b9b42abc64f7ea 100644 (file)
@@ -1228,6 +1228,9 @@ static int clear_rip_route_rpc(const char *xpath, const struct list *input,
        struct list *list;
        struct listnode *listnode;
 
+       if (!rip)
+               return NB_OK;
+
        /* Clear received RIP routes */
        for (rp = route_top(rip->table); rp; rp = route_next(rp)) {
                list = rp->info;
index 7993714e8d3540a5c93cfe380320651032239049..69e207f443c3b18c90ff08a0e8598925e2967375 100644 (file)
@@ -785,6 +785,9 @@ static int clear_ripng_route_rpc(const char *xpath, const struct list *input,
        struct list *list;
        struct listnode *listnode;
 
+       if (!ripng)
+               return NB_OK;
+
        /* Clear received RIPng routes */
        for (rp = agg_route_top(ripng->table); rp; rp = agg_route_next(rp)) {
                list = rp->info;