o Fixed a bug in traceroute that could lead to a crash:

terminate called after throwing an instance of 'std::out_of_range'
      what():  bitset::test
  It happened when the preliminary distance guess for a target was
  greater than 30, the size of an internal data structure. David and
  Brandon tracked down the problem.
This commit is contained in:
david 2010-01-14 01:07:49 +00:00
parent 958ba69422
commit 9b468484c2
2 changed files with 9 additions and 2 deletions

View file

@ -1,5 +1,12 @@
# Nmap Changelog ($Id$); -*-text-*-
o Fixed a bug in traceroute that could lead to a crash:
terminate called after throwing an instance of 'std::out_of_range'
what(): bitset::test
It happened when the preliminary distance guess for a target was
greater than 30, the size of an internal data structure. David and
Brandon tracked down the problem.
o Added a service probe and match lines for the Logitech/SlimDevices
SqueezeCenter music server. [Patrik Karlsson]

View file

@ -333,7 +333,7 @@ static unsigned int hop_cache_size();
HostState::HostState(Target *target) {
this->target = target;
current_ttl = MAX(1, HostState::distance_guess(target));
current_ttl = MIN(MAX(1, HostState::distance_guess(target)), MAX_TTL);
state = HostState::COUNTING_DOWN;
reached_target = 0;
pspec = HostState::get_probe(target);
@ -1203,7 +1203,7 @@ void TracerouteState::read_replies(long timeout) {
actual distance is. */
int distance = get_initial_ttl_guess(reply.ttl) - reply.ttl + 1;
if (distance > 0 && distance < host->current_ttl)
host->current_ttl = distance;
host->current_ttl = MIN(distance, MAX_TTL);
}
num_active_probes -= host->cancel_probes_above(probe->ttl);
}