Fix coverity warnings, VPP-486 64/3864/2
authorDave Barach <[email protected]>
Thu, 17 Nov 2016 16:36:59 +0000 (11:36 -0500)
committerDamjan Marion <[email protected]>
Thu, 17 Nov 2016 20:51:43 +0000 (20:51 +0000)
Change-Id: If98e5e00eede8f2aa9f17517c726b337c98e5467
Signed-off-by: Dave Barach <[email protected]>
vnet/vnet/l2tp/decap.c
vpp-api-test/vat/api_format.c

index e91e6fb..ee307b6 100644 (file)
@@ -126,7 +126,7 @@ last_stage (vlib_main_t * vm, vlib_node_runtime_t * node, u32 bi)
   vlib_error_main_t *em = &vm->error_main;
   l2tpv3_header_t *l2tp;
   u32 counter_index;
-  l2t_session_t *session;
+  l2t_session_t *session = 0;
   u32 session_index;
   u32 next_index;
   u8 l2tp_decap_local = (l2t_decap_local_node.index == n->index);
@@ -218,6 +218,7 @@ done:
       else
        {
          /* Go to next node on the ip6 configuration chain */
+         ASSERT (session);
          vnet_feature_next (session->sw_if_index, &next_index, b);
        }
     }
index c170147..aa87525 100644 (file)
@@ -6492,6 +6492,9 @@ api_mpls_ethernet_add_del_tunnel (vat_main_t * vam)
   u32 tx_sw_if_index;
   int tx_sw_if_index_set = 0;
 
+  /* Shut up coverity */
+  memset (dst_mac_address, 0, sizeof (dst_mac_address));
+
   while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
     {
       if (unformat (i, "vrf %d", &inner_vrf_id))
@@ -10581,6 +10584,9 @@ api_create_vhost_user_if (vat_main_t * vam)
   u8 hwaddr[6];
   u8 use_custom_mac = 0;
 
+  /* Shut up coverity */
+  memset (hwaddr, 0, sizeof (hwaddr));
+
   while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
     {
       if (unformat (i, "socket %s", &file_name))
@@ -16112,6 +16118,10 @@ api_l2_interface_pbb_tag_rewrite (vat_main_t * vam)
   u32 sid = ~0;
   u32 tmp;
 
+  /* Shut up coverity */
+  memset (dmac, 0, sizeof (dmac));
+  memset (smac, 0, sizeof (smac));
+
   while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
     {
       if (unformat (i, "%U", unformat_sw_if_index, vam, &sw_if_index))