mirror of
https://github.com/curl/curl.git
synced 2026-07-03 17:57:20 +03:00
setopt: make CURLOPT_TFTP_BLKSIZE accept bad values
... and just move them into the accepted range. Like how buffersize and a few other options work. Closes #14634
This commit is contained in:
parent
05609bac95
commit
17dde53968
1 changed files with 4 additions and 2 deletions
|
|
@ -425,8 +425,10 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
|
|||
* TFTP option that specifies the block size to use for data transmission.
|
||||
*/
|
||||
arg = va_arg(param, long);
|
||||
if(arg > TFTP_BLKSIZE_MAX || arg < TFTP_BLKSIZE_MIN)
|
||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
if(arg < TFTP_BLKSIZE_MIN)
|
||||
arg = 512;
|
||||
else if(arg > TFTP_BLKSIZE_MAX)
|
||||
arg = TFTP_BLKSIZE_MAX;
|
||||
data->set.tftp_blksize = arg;
|
||||
break;
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue