summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatus Uzak <matus.uzak@gmail.com>2018-12-18 22:28:20 +0100
committerDaniel Stenberg <daniel@haxx.se>2018-12-19 09:52:36 +0100
commit462037ad487c0457451e66afd0cb50a9f70c0c28 (patch)
tree82032c33066796a3a6eb6e24b1acc68b5f9eb097
parent4849267197682e69cfa056c2bd7a44acd123a917 (diff)
downloadcurl-462037ad487c0457451e66afd0cb50a9f70c0c28.tar.gz
smb: fix incorrect path in request if connection reused
Follow-up to 09e401e01bf9. If connection gets reused, then data member will be copied, but not the proto member. As a result, in smb_do(), path has been set from the original proto.share data. Closes #3388
-rw-r--r--lib/smb.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/smb.c b/lib/smb.c
index e4f266e19..76c99a230 100644
--- a/lib/smb.c
+++ b/lib/smb.c
@@ -947,15 +947,10 @@ static int smb_getsock(struct connectdata *conn, curl_socket_t *socks,
static CURLcode smb_do(struct connectdata *conn, bool *done)
{
struct smb_conn *smbc = &conn->proto.smbc;
- struct smb_request *req = conn->data->req.protop;
*done = FALSE;
if(smbc->share) {
- req->path = strchr(smbc->share, '\0');
- if(req->path) {
- req->path++;
- return CURLE_OK;
- }
+ return CURLE_OK;
}
return CURLE_URL_MALFORMAT;
}
@@ -964,6 +959,7 @@ static CURLcode smb_parse_url_path(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
struct Curl_easy *data = conn->data;
+ struct smb_request *req = data->req.protop;
struct smb_conn *smbc = &conn->proto.smbc;
char *path;
char *slash;
@@ -992,6 +988,7 @@ static CURLcode smb_parse_url_path(struct connectdata *conn)
/* Parse the path for the file path converting any forward slashes into
backslashes */
*slash++ = 0;
+ req->path = slash;
for(; *slash; slash++) {
if(*slash == '/')