From 4cfecc3ea9dd2c4d3d5f5d4a17971f9cc826e14c Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Fri, 19 Oct 2018 15:55:31 -0300 Subject: [PATCH] lib: fix the "no match ipv6 next-hop type" command Trivial NULL pointer dereference bug. Fixes the following crash: bgpd aborted: vtysh -c "configure terminal" -c "route-map RMAP permit 1" -c "no match ipv6 next-hop type" Signed-off-by: Renato Westphal --- lib/routemap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/routemap.c b/lib/routemap.c index 3a20ed5cda..6d6267af6b 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -2251,7 +2251,8 @@ DEFUN(no_match_ipv6_next_hop_type, no_match_ipv6_next_hop_type_cmd, if (rmap_match_set_hook.no_match_ipv6_next_hop_type) return rmap_match_set_hook.no_match_ipv6_next_hop_type( - vty, index, "ipv6 next-hop type", argv[idx_word]->arg, + vty, index, "ipv6 next-hop type", + (argc <= idx_word) ? NULL : argv[idx_word]->arg, RMAP_EVENT_MATCH_DELETED); return CMD_SUCCESS; } -- 2.39.5