tool_getparam: error out on missing -K file

Add test 411 to verify.

Reported-by: Median Median Stride
Bug: https://hackerone.com/reports/1542881
Closes #8731
This commit is contained in:
Daniel Stenberg 2022-04-25 11:38:37 +02:00
parent ca94497a82
commit a09a12806e
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 48 additions and 4 deletions

View file

@ -1948,9 +1948,10 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
config->insecure_ok = toggle;
break;
case 'K': /* parse config file */
if(parseconfig(nextarg, global))
warnf(global, "error trying read config from the '%s' file\n",
nextarg);
if(parseconfig(nextarg, global)) {
errorf(global, "cannot read config from '%s'\n", nextarg);
return PARAM_READ_ERROR;
}
break;
case 'l':
config->dirlistonly = toggle; /* only list the names of the FTP dir */