diff options
author | Daniel Stenberg <daniel@haxx.se> | 2014-04-15 13:49:18 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2014-04-26 18:17:10 +0200 |
commit | d5ec44ca4cca9bbe6c21a1d2a94b37cba77661ff (patch) | |
tree | 7d4f6429f80bacd0a314726572bdddbc265f7c72 /lib/tftp.c | |
parent | 9c941e92c4bd3d2a5dbe243f7517b6a6029afc6e (diff) | |
download | curl-d5ec44ca4cca9bbe6c21a1d2a94b37cba77661ff.tar.gz |
INFILESIZE: fields in UserDefined must not be changed run-time
set.infilesize in this case was modified in several places, which could
lead to repeated requests using the same handle to get unintendent/wrong
consequences based on what the previous request did!
Diffstat (limited to 'lib/tftp.c')
-rw-r--r-- | lib/tftp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/tftp.c b/lib/tftp.c index 03a84e631..d19f48029 100644 --- a/lib/tftp.c +++ b/lib/tftp.c @@ -477,8 +477,8 @@ static CURLcode tftp_send_first(tftp_state_data_t *state, tftp_event_t event) setpacketevent(&state->spacket, TFTP_EVENT_WRQ); state->conn->data->req.upload_fromhere = (char *)state->spacket.data+4; - if(data->set.infilesize != -1) - Curl_pgrsSetUploadSize(data, data->set.infilesize); + if(data->state.infilesize != -1) + Curl_pgrsSetUploadSize(data, data->state.infilesize); } else { /* If we are downloading, send an RRQ */ @@ -498,9 +498,9 @@ static CURLcode tftp_send_first(tftp_state_data_t *state, tftp_event_t event) sbytes = 4 + strlen(filename) + strlen(mode); /* add tsize option */ - if(data->set.upload && (data->set.infilesize != -1)) + if(data->set.upload && (data->state.infilesize != -1)) snprintf(buf, sizeof(buf), "%" CURL_FORMAT_CURL_OFF_T, - data->set.infilesize); + data->state.infilesize); else strcpy(buf, "0"); /* the destination is large enough */ |