mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Avoid crashing when Nsock connect calls the callback immediately due to parameter errors
This commit is contained in:
@@ -2261,10 +2261,15 @@ static int launchSomeServiceProbes(nsock_pool nsp, ServiceGroup *SG) {
|
||||
svc, (struct sockaddr *) &ss, ss_len,
|
||||
svc->portno);
|
||||
}
|
||||
// Now remove it from the remaining service list
|
||||
SG->services_remaining.pop_front();
|
||||
// And add it to the in progress list
|
||||
SG->services_in_progress.push_back(svc);
|
||||
// Check that the service is still where we left it.
|
||||
// servicescan_connect_handler can call end_svcprobe before this point,
|
||||
// putting it into services_finished already.
|
||||
if (SG->services_remaining.front() == svc) {
|
||||
// Now remove it from the remaining service list
|
||||
SG->services_remaining.pop_front();
|
||||
// And add it to the in progress list
|
||||
SG->services_in_progress.push_back(svc);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user