mirror of
https://github.com/curl/curl.git
synced 2026-07-30 01:48:04 +03:00
setopt: check CURLOPT_TFTP_BLKSIZE range on set
... instead of later when the transfer is about to happen. Closes #12374
This commit is contained in:
parent
84338c4de2
commit
49c413cce2
3 changed files with 7 additions and 7 deletions
|
|
@ -50,6 +50,7 @@
|
|||
#include "multiif.h"
|
||||
#include "altsvc.h"
|
||||
#include "hsts.h"
|
||||
#include "tftp.h"
|
||||
|
||||
/* The last 3 #include files should be in this order */
|
||||
#include "curl_printf.h"
|
||||
|
|
@ -379,7 +380,7 @@ 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 < 0)
|
||||
if(arg > TFTP_BLKSIZE_MAX || arg < TFTP_BLKSIZE_MIN)
|
||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
data->set.tftp_blksize = arg;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue