From 14705cd417cbb1cd6c685922c1348a8572b95866 Mon Sep 17 00:00:00 2001 From: dmiller Date: Mon, 22 Oct 2018 20:12:45 +0000 Subject: [PATCH] ultrascan: bail early if there are no probes in the current scan This shouldn't ever happen, but it currently does for host discovery scans using -PR where the target is not directly connected. See #1361 --- scan_engine.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scan_engine.cc b/scan_engine.cc index 342f0963e..c71a524c2 100644 --- a/scan_engine.cc +++ b/scan_engine.cc @@ -2730,6 +2730,13 @@ void ultra_scan(std::vector &Targets, struct scan_lists *ports, UltraScanInfo USI(Targets, ports, scantype); + if (USI.gstats->numprobes <= 0) { + if (o.debugging) { + log_write(LOG_STDOUT, "Skipping %s: no probes to send\n", scantype2str(scantype)); + } + return; + } + /* Use the requested timeouts. */ if (to != NULL) USI.gstats->to = *to;