mirror of
https://github.com/nmap/nmap.git
synced 2026-10-08 21:36:20 +00:00
Fix assertion failure in do_one_select_round
Since the refactor in r33185, getting a good response for a host during a ping scan can remove all outstanding probes for that host, since we already know the host is up. This broke the existing iteration in some cases. I could force the crash with: nmap -sn -PS80-89 scanme.nmap.org Now we check explicitly for an empty list each time through the loop.
This commit is contained in:
parent
65c50eb695
commit
567e344ad7
1 changed files with 1 additions and 1 deletions
|
|
@ -4203,7 +4203,7 @@ static bool do_one_select_round(UltraScanInfo *USI, struct timeval *stime) {
|
|||
|
||||
std::list<UltraProbe *>::iterator nextProbeI;
|
||||
for (std::list<UltraProbe *>::iterator probeI = host->probes_outstanding.begin(), end = host->probes_outstanding.end();
|
||||
probeI != end && numGoodSD < selectres; probeI = nextProbeI) {
|
||||
probeI != end && numGoodSD < selectres && host->num_probes_outstanding() > 0; probeI = nextProbeI) {
|
||||
/* handleConnectResult may remove the probe at probeI, which invalidates
|
||||
* the iterator. We copy and increment it here instead of in the for-loop
|
||||
* statement to avoid incrementing an invalid iterator */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue