From 2c6666cb349dc14950ff8ae328334f2f7c07aadb Mon Sep 17 00:00:00 2001 From: dmiller Date: Thu, 1 Sep 2016 03:34:22 +0000 Subject: [PATCH] Avoid crash if Npcap is not present when doing reverse DNS. --- nmap_dns.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nmap_dns.cc b/nmap_dns.cc index d075abf63..634abfd6f 100644 --- a/nmap_dns.cc +++ b/nmap_dns.cc @@ -965,7 +965,8 @@ void win32_read_registry() { for (i=0; sz = sizeof(buf), RegEnumKeyEx(hKey, i, buf, &sz, NULL, NULL, NULL, NULL) != ERROR_NO_MORE_ITEMS; i++) { - if (!interface_is_known_by_guid(buf)) { + // If we don't have pcap, interface_is_known_by_guid will crash. Just use any servers we can find. + if (o.have_pcap && !interface_is_known_by_guid(buf)) { if (o.debugging > 1) log_write(LOG_PLAIN, "Interface %s is not known; ignoring its nameservers.\n", buf); continue;