From 08435c2b24298d1c716f58fd4fc4d1bb3ea6f03b Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 24 Jan 2017 09:47:59 -0500 Subject: [PATCH] bgpd: Fix crash with parsing the community Signed-off-by: Donald Sharp --- bgpd/bgp_route.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index c5b7c4e776..92a2843ba9 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -7924,12 +7924,11 @@ DEFUN (show_ip_bgp, if (argv_find(argv, argc, "community", &idx)) { /* show a specific community */ - if (argv[idx + 1]->type == VARIABLE_TKN || - strmatch(argv[idx + 1]->text, "local-AS") || - strmatch(argv[idx + 1]->text, "no-advertise") || - strmatch(argv[idx + 1]->text, "no-export")) + if (argv_find (argv, argc, "local-AS", &idx) || + argv_find (argv, argc, "no-advertise", &idx) || + argv_find (argv, argc, "no-export", &idx)) { - if (strmatch(argv[idx + 2]->text, "exact_match")) + if (argv_find (argv, argc, "exact_match", &idx)) exact_match = 1; return bgp_show_community (vty, bgp, argc, argv, exact_match, afi, safi); } -- 2.39.5