aboutsummaryrefslogtreecommitdiff
path: root/pcap-bt-linux.c
diff options
context:
space:
mode:
Diffstat (limited to 'pcap-bt-linux.c')
-rw-r--r--pcap-bt-linux.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/pcap-bt-linux.c b/pcap-bt-linux.c
index 8e70febc..37c80565 100644
--- a/pcap-bt-linux.c
+++ b/pcap-bt-linux.c
@@ -98,6 +98,14 @@ bt_findalldevs(pcap_if_list_t *devlistp, char *err_str)
goto done;
}
+ /*
+ * Zero the complete header, which is larger than dev_num because of tail
+ * padding, to silence Valgrind, which overshoots validating that dev_num
+ * has been set.
+ * https://github.com/the-tcpdump-group/libpcap/issues/1083
+ * https://bugs.kde.org/show_bug.cgi?id=448464
+ */
+ memset(dev_list, 0, sizeof(*dev_list));
dev_list->dev_num = HCI_MAX_DEV;
if (ioctl(sock, HCIGETDEVLIST, (void *) dev_list) < 0)