bridge: Fix use-after-free in bridge_aa_refresh_queue().
authorBen Pfaff <blp@nicira.com>
Thu, 16 Apr 2015 21:49:23 +0000 (14:49 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 17 Apr 2015 16:23:20 +0000 (09:23 -0700)
Found by LLVM scan-build.

Reported-by: Kevin Lo <kevlo@FreeBSD.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Dennis Flynn <drflynn@avaya.com>
vswitchd/bridge.c

index ea7d788..ee96f38 100644 (file)
@@ -3920,12 +3920,12 @@ static void
 bridge_aa_refresh_queued(struct bridge *br)
 {
     struct ovs_list *list = xmalloc(sizeof *list);
-    struct bridge_aa_vlan *node;
+    struct bridge_aa_vlan *node, *next;
 
     list_init(list);
     ofproto_aa_vlan_get_queued(br->ofproto, list);
 
-    LIST_FOR_EACH(node, list_node, list) {
+    LIST_FOR_EACH_SAFE (node, next, list_node, list) {
         struct port *port;
 
         VLOG_INFO("ifname=%s, vlan=%u, oper=%u", node->port_name, node->vlan,