]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: fix the "no match ipv6 next-hop type" command
authorRenato Westphal <renato@opensourcerouting.org>
Fri, 19 Oct 2018 18:55:31 +0000 (15:55 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Sat, 20 Oct 2018 15:39:05 +0000 (12:39 -0300)
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 <renato@opensourcerouting.org>
lib/routemap.c

index 3a20ed5cdaea91e83096de38c137b339a38123ff..6d6267af6b1e401015996df8fe56ab46e0c222f7 100644 (file)
@@ -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;
 }