Actually initialize the localhost ethernet address before setting
authorJeff Morriss <jeff.morriss.ws@gmail.com>
Sun, 30 Jun 2013 21:34:40 +0000 (21:34 -0000)
committerJeff Morriss <jeff.morriss.ws@gmail.com>
Sun, 30 Jun 2013 21:34:40 +0000 (21:34 -0000)
dl_src/dl_dst to it.

Fixes uninitialized-read warnings from Valgrind on the capture in
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8827

svn path=/trunk/; revision=50268

epan/dissectors/packet-bthci_acl.c

index 9a8195b18a2e0007a703ff4219b30030d8927688..bbdfc91603d4525f07355c291de21236f414d7af 100644 (file)
@@ -258,10 +258,15 @@ dissect_bthci_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
     localhost_bdaddr_entry = (localhost_bdaddr_entry_t *)wmem_tree_lookup32_array_le(hci_data->localhost_bdaddr, key);
     if (localhost_bdaddr_entry && localhost_bdaddr_entry->interface_id == hci_data->interface_id &&
-            localhost_bdaddr_entry->adapter_id == hci_data->adapter_id)
+        localhost_bdaddr_entry->adapter_id == hci_data->adapter_id) {
+
         localhost_ether_addr = get_ether_name(localhost_bdaddr_entry->bd_addr);
-    else
+        memcpy(localhost_bdaddr, localhost_bdaddr_entry->bd_addr, 6);
+    } else { 
         localhost_ether_addr = "localhost";
+        /* XXX - is this the right value to use? */
+        memset(localhost_bdaddr, 0, 6);
+    }
 
     localhost_name_entry = (localhost_name_entry_t *)wmem_tree_lookup32_array_le(hci_data->localhost_name, key);
     if (localhost_name_entry && localhost_name_entry->interface_id == hci_data->interface_id &&