From: Renato Westphal Date: Fri, 4 Jan 2019 13:55:15 +0000 (-0200) Subject: ripd, ripngd: fix null pointer dereference in YANG RPCs X-Git-Tag: frr-7.1~111^2~36 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=bb5d09c90c277ed12aa41c84f8f9026b47694c60;p=mirror_frr.git ripd, ripngd: fix null pointer dereference in YANG RPCs These RPCs should do nothing when RIP/RIPng aren't configured. Signed-off-by: Renato Westphal --- diff --git a/ripd/rip_northbound.c b/ripd/rip_northbound.c index 4e445bd46..49bf90198 100644 --- a/ripd/rip_northbound.c +++ b/ripd/rip_northbound.c @@ -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; diff --git a/ripngd/ripng_northbound.c b/ripngd/ripng_northbound.c index 7993714e8..69e207f44 100644 --- a/ripngd/ripng_northbound.c +++ b/ripngd/ripng_northbound.c @@ -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;