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()) {