aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorFabian Keil <fk@fabiankeil.de>2013-07-13 14:12:18 +0200
committerDaniel Stenberg <daniel@haxx.se>2013-07-23 20:51:15 +0200
commit2c4ef997b97fa32b1f67c12f0de24528f43792f8 (patch)
tree83e7bdb10f8f1f623b49fb8029f723bd788401f6 /lib/url.c
parentd020e2c3819f838c2180342b22a5bdf8d4c89d9b (diff)
url.c: Fix dot file path cleanup when using an HTTP proxy
Previously the path was cleaned, but the URL wasn't properly updated.
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/url.c b/lib/url.c
index cda4e4825..a8f2a0985 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -3899,15 +3899,20 @@ static CURLcode parseurlandfillconn(struct SessionHandle *data,
the original */
size_t urllen = strlen(data->change.url); /* original URL length */
+ size_t prefixlen = strlen(conn->host.name);
+
+ if(!*prot_missing)
+ prefixlen += strlen(protop) + strlen("://");
+
reurl = malloc(urllen + 2); /* 2 for zerobyte + slash */
if(!reurl)
return CURLE_OUT_OF_MEMORY;
/* copy the prefix */
- memcpy(reurl, data->change.url, urllen - (plen-1));
+ memcpy(reurl, data->change.url, prefixlen);
/* append the trailing piece + zerobyte */
- memcpy(&reurl[urllen - (plen-1)], path, plen + 1);
+ memcpy(&reurl[prefixlen], path, plen + 1);
/* possible free the old one */
if(data->change.url_alloc) {