From d5ec44ca4cca9bbe6c21a1d2a94b37cba77661ff Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 15 Apr 2014 13:49:18 +0200 Subject: 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! --- lib/tftp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/tftp.c') 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 */ -- cgit v1.2.3