Skip to content

Commit

Permalink
ripd, ripngd: fix null pointer dereference in YANG RPCs
Browse files Browse the repository at this point in the history
These RPCs should do nothing when RIP/RIPng aren't configured.

Signed-off-by: Renato Westphal <[email protected]>
  • Loading branch information
rwestphal committed Jan 18, 2019
1 parent 70fc94c commit bb5d09c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ripd/rip_northbound.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions ripngd/ripng_northbound.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bb5d09c

Please sign in to comment.