From: Donald Sharp Date: Tue, 24 Jan 2017 14:47:59 +0000 (-0500) Subject: bgpd: Fix crash with parsing the community X-Git-Tag: frr-3.0-branchpoint~71^2^2~7 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=08435c2b24298d1c716f58fd4fc4d1bb3ea6f03b;p=mirror%2Ffrr.git bgpd: Fix crash with parsing the community Signed-off-by: Donald Sharp --- 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); }