1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Fix WinPcap crash on pcap_findalldevs error

See http://seclists.org/nmap-dev/2015/q1/176

Fixes #15
This commit is contained in:
dmiller
2015-02-12 16:52:02 +00:00
parent 54c737a377
commit a86b679404
4 changed files with 33 additions and 3 deletions

View File

@@ -2033,9 +2033,10 @@ pcap_if_t *getpcapinterfaces() {
return NULL;
#endif
pcap_if_t *p_ifaces;
char errbuf[PCAP_ERRBUF_SIZE];
if ((pcap_findalldevs(&p_ifaces, NULL)) == -1) {
fatal("pcap_findalldevs() : Cannot retrieve pcap interfaces");
if ((pcap_findalldevs(&p_ifaces, errbuf)) == -1) {
fatal("pcap_findalldevs(): Cannot retrieve pcap interfaces: %s", errbuf);
return NULL;
}
return p_ifaces;