summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-09-27 06:45:32 +0000
committerRoger Dingledine <arma@torproject.org>2004-09-27 06:45:32 +0000
commit6e7e880438354d7c47f2a131143dc0f8baf70e6a (patch)
treeb515ada70e0db246dd25edcbdf2ef4279df47b66
parenta2517b4f0777c961843f3dc65107e9d3ce6b3846 (diff)
downloadtor-6e7e880438354d7c47f2a131143dc0f8baf70e6a.tar.gz
tor-6e7e880438354d7c47f2a131143dc0f8baf70e6a.zip
put my fenceposts back in valid memory space
svn:r2381
-rw-r--r--src/or/directory.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index d7b47c73e2..c88cae693c 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -284,14 +284,13 @@ parse_http_url(char *headers, char **url)
s = (char *)eat_whitespace_no_nl(s);
if (!*s) return -1;
start = s; /* this is it, assuming it's valid */
- s = (char *)find_whitespace(s);
+ s = (char *)find_whitespace(start);
if (!*s) return -1;
- *s = 0;
if(s-start < 5 || strcmpstart(start,"/tor/")) { /* need to rewrite it */
*url = tor_malloc(s - start + 5);
strcpy(*url,"/tor");
- strlcpy(*url+4, start, s-start+1);
- *url[s-start+4] = 0; /* null terminate it */
+ strlcpy((*url)+4, start, s-start+1);
+ (*url)[s-start+4] = 0; /* null terminate it */
} else {
*url = tor_strndup(start, s-start);
}