diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-09-06 20:26:20 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-09-06 20:26:20 -0400 |
commit | 2bf0e7479bc9ec26496405ff6a1ef830cacc001b (patch) | |
tree | 90d64ba5b4d43ef937fcf55b612fc9dca5a0f96f /src/or/connection_edge.c | |
parent | e0dae64449958f4c80e6da1ee6a336a60ffc21d5 (diff) | |
download | tor-2bf0e7479bc9ec26496405ff6a1ef830cacc001b.tar.gz tor-2bf0e7479bc9ec26496405ff6a1ef830cacc001b.zip |
Fix assertion in addressmap_clear_excluded_trackexithosts
Fixes bug 3923; bugfix on 0.2.2.25-alpha; bugfix from 'laruldan' on trac.
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r-- | src/or/connection_edge.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index d4d7e1c73c..8609b023d5 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -842,12 +842,10 @@ addressmap_clear_excluded_trackexithosts(or_options_t *options) if (len < 6) continue; /* malformed. */ dot = target + len - 6; /* dot now points to just before .exit */ - dot = strrchr(dot, '.'); /* dot now points to the . before .exit or NULL */ - if (!dot) { - nodename = tor_strndup(target, len-5); - } else { - nodename = tor_strndup(dot+1, strlen(dot+1)-5); - } + while(dot > target && *dot != '.') + dot--; + if (*dot == '.') dot++; + nodename = tor_strndup(dot, len-5-(dot-target));; ri = router_get_by_nickname(nodename, 0); tor_free(nodename); if (!ri || |