summaryrefslogtreecommitdiff
path: root/caputils/capture-pcap-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'caputils/capture-pcap-util.c')
-rw-r--r--caputils/capture-pcap-util.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/caputils/capture-pcap-util.c b/caputils/capture-pcap-util.c
index 8755fcefaf..1c2cd2c36e 100644
--- a/caputils/capture-pcap-util.c
+++ b/caputils/capture-pcap-util.c
@@ -427,9 +427,13 @@ get_interface_list_findalldevs_ex(const char *source,
GList *il = NULL;
pcap_if_t *alldevs, *dev;
if_info_t *if_info;
- char errbuf[PCAP_ERRBUF_SIZE];
+ /*
+ * WinPcap can overflow PCAP_ERRBUF_SIZE if the host is unreachable.
+ * Fudge a larger size.
+ */
+ char errbuf[PCAP_ERRBUF_SIZE*4];
- if (pcap_findalldevs_ex((char *)source, auth, &alldevs, errbuf) == -1) {
+ if (pcap_findalldevs_ex((char *)source, auth, &alldevs, errbuf) == -1) {
*err = CANT_GET_INTERFACE_LIST;
if (err_str != NULL)
*err_str = cant_get_if_list_error_message(errbuf);