odp-util: Initialize tun_key and tun_key_mask
authorThomas Graf <tgraf@noironetworks.com>
Tue, 26 Aug 2014 00:49:55 +0000 (02:49 +0200)
committerBen Pfaff <blp@nicira.com>
Tue, 26 Aug 2014 15:35:45 +0000 (08:35 -0700)
tun_key_to_attr() accesses tp_src and tp_dst which are currently
uinitialized.

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/odp-util.c

index ffc3673..19d0627 100644 (file)
@@ -1784,6 +1784,9 @@ parse_odp_key_mask_attr(const char *s, const struct simap *port_names,
         struct flow_tnl tun_key, tun_key_mask;
         int n = -1;
 
+        memset(&tun_key, 0, sizeof tun_key);
+        memset(&tun_key_mask, 0, sizeof tun_key_mask);
+
         if (mask && ovs_scan(s, "tunnel(tun_id=%"SCNi64"/%"SCNi64","
                              "src="IP_SCAN_FMT"/"IP_SCAN_FMT",dst="IP_SCAN_FMT
                              "/"IP_SCAN_FMT",tos=%"SCNi8"/%"SCNi8","