http_aws_sigv4: skip the op if the query pair is zero bytes

Follow-up to fc76a24c53

Spotted by OSS-Fuzz

Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=62175
Closes #11823
This commit is contained in:
Daniel Stenberg 2023-09-08 18:13:14 +02:00
parent 4600bd3993
commit 16bdc09ee0
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -422,6 +422,8 @@ static CURLcode canon_query(struct Curl_easy *data,
for(i = 0; !result && (i < entry); i++, ap++) {
size_t len;
const char *q = ap->p;
if(!ap->len)
continue;
for(len = ap->len; len && !result; q++, len--) {
if(ISALNUM(*q))
result = Curl_dyn_addn(dq, q, 1);