]> git.proxmox.com Git - mirror_frr.git/commitdiff
Variable reuse in bgpd.c
authorDenil Vira <denil@cumulusnetworks.com>
Tue, 11 Aug 2015 15:35:52 +0000 (08:35 -0700)
committerDenil Vira <denil@cumulusnetworks.com>
Tue, 11 Aug 2015 15:35:52 +0000 (08:35 -0700)
Ticket : CM-7004
Reviewed by : CCR-3314
Testing : Trivial

In bgp_delete(), variables 'node' and 'next' are overwritten in
the nested for loop.

bgpd/bgpd.c

index 16bfb504078db50aeae86a097dc6b52b8ae0a082..7651505a650b5c642ad936a3b3bf685a812343cc 100644 (file)
@@ -2759,8 +2759,8 @@ bgp_delete (struct bgp *bgp)
 {
   struct peer *peer;
   struct peer_group *group;
-  struct listnode *node;
-  struct listnode *next;
+  struct listnode *node, *pnode;
+  struct listnode *next, *pnext;
   afi_t afi;
   int i;
 
@@ -2791,7 +2791,7 @@ bgp_delete (struct bgp *bgp)
 
   for (ALL_LIST_ELEMENTS (bgp->group, node, next, group))
     {
-      for (ALL_LIST_ELEMENTS (group->peer, node, next, peer))
+      for (ALL_LIST_ELEMENTS (group->peer, pnode, pnext, peer))
        {
          if (BGP_IS_VALID_STATE_FOR_NOTIF(peer->status))
            {