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:
5
tcpip.cc
5
tcpip.cc
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user