From 99a2835d7dfee03c18ef093297788867f34087ff Mon Sep 17 00:00:00 2001 From: david Date: Mon, 7 Sep 2009 22:03:27 +0000 Subject: [PATCH] Let Nmap run if the nmap-service-probes file is empty. Patch by Ankur Nandwani. --- service_scan.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/service_scan.cc b/service_scan.cc index 0a754b4b4..fd7900931 100644 --- a/service_scan.cc +++ b/service_scan.cc @@ -1126,14 +1126,14 @@ void parse_nmap_service_probe_file(AllProbes *AP, char *filename) { } } - assert(newProbe); - if (newProbe->isNullProbe()) { - assert(!AP->nullProbe); - AP->nullProbe = newProbe; - } else { - AP->probes.push_back(newProbe); + if (newProbe != NULL) { + if (newProbe->isNullProbe()) { + assert(!AP->nullProbe); + AP->nullProbe = newProbe; + } else { + AP->probes.push_back(newProbe); + } } - fclose(fp); AP->compileFallbacks(); @@ -1280,7 +1280,8 @@ void AllProbes::compileFallbacks() { curr = probes.begin(); // The NULL probe is a special case: - nullProbe->fallbacks[0] = nullProbe; + if (nullProbe != NULL) + nullProbe->fallbacks[0] = nullProbe; while (curr != probes.end()) {