Merge remote-tracking branch 'origin/maint-0.2.2'

Conflicts:
	src/or/connection_edge.c

Conflicted on a router->node transition; fix was easy.
This commit is contained in:
Nick Mathewson 2011-09-06 20:55:31 -04:00
commit 9ef2cd7776
2 changed files with 9 additions and 6 deletions

5
changes/bug3923 Normal file
View File

@ -0,0 +1,5 @@
o Major bugfies:
- Avoid an assertion failure when reloading a configuration with
TrackExitHosts changes. Found and fixed by 'laruldan'. Fixes
bug 3923; bugfix on 0.2.2.25-alpha.

View File

@ -930,12 +930,10 @@ addressmap_clear_excluded_trackexithosts(const or_options_t *options)
if (len < 6) if (len < 6)
continue; /* malformed. */ continue; /* malformed. */
dot = target + len - 6; /* dot now points to just before .exit */ dot = target + len - 6; /* dot now points to just before .exit */
dot = strrchr(dot, '.'); /* dot now points to the . before .exit or NULL */ while(dot > target && *dot != '.')
if (!dot) { dot--;
nodename = tor_strndup(target, len-5); if (*dot == '.') dot++;
} else { nodename = tor_strndup(dot, len-5-(dot-target));;
nodename = tor_strndup(dot+1, strlen(dot+1)-5);
}
node = node_get_by_nickname(nodename, 0); node = node_get_by_nickname(nodename, 0);
tor_free(nodename); tor_free(nodename);
if (!node || if (!node ||