aboutsummaryrefslogtreecommitdiff
path: root/pcap-bt-linux.c
diff options
context:
space:
mode:
authorDenis Ovsienko <denis@ovsienko.info>2022-01-15 21:41:18 +0000
committerDenis Ovsienko <denis@ovsienko.info>2022-01-15 21:41:18 +0000
commitb615db42e75e67cd948430a8abaae6b175ab9e43 (patch)
treec777df42be5598633348bca7e0e625812af4d8f0 /pcap-bt-linux.c
parente6d1929c1dd2345e318223b7fa8f33eb7b6e688b (diff)
Squelch a false Valgrind error in bt_findalldevs().
This issue was reported by Andrea Odetti in GH #1083.
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)