]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Fix crash with parsing the community
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 24 Jan 2017 14:47:59 +0000 (09:47 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 24 Jan 2017 14:47:59 +0000 (09:47 -0500)
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/bgp_route.c

index c5b7c4e776f47a41f0a6f96f5c907df1ca814636..92a2843ba977e7b684c9eed3f08b1253dbb3efe4 100644 (file)
@@ -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);
         }