aws-sigv4: allow a blank string

make sure a zero length sigv4 gets the default value

Reported-by: Arian van Putten
Fixes #17176
Closes #17178
This commit is contained in:
Daniel Stenberg 2025-04-24 23:39:08 +02:00
parent ae0ff69f7a
commit 2ab6b9d405
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 4 additions and 3 deletions

View File

@ -676,8 +676,9 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data)
* AWS is the default because most of non-amazon providers
* are still using aws:amz as a prefix.
*/
line = data->set.str[STRING_AWS_SIGV4] ?
data->set.str[STRING_AWS_SIGV4] : "aws:amz";
line = data->set.str[STRING_AWS_SIGV4];
if(!line || !*line)
line = "aws:amz";
/* provider0[:provider1[:region[:service]]]

View File

@ -2005,7 +2005,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
break;
case C_AWS_SIGV4: /* --aws-sigv4 */
config->authtype |= CURLAUTH_AWS_SIGV4;
err = getstr(&config->aws_sigv4, nextarg, DENY_BLANK);
err = getstr(&config->aws_sigv4, nextarg, ALLOW_BLANK);
break;
case C_STDERR: /* --stderr */
tool_set_stderr_file(global, nextarg);