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);