From: Daniel Stenberg Date: Fri, 1 Sep 2023 08:35:40 +0000 (+0200) Subject: awssiv4: avoid freeing the date pointer on error X-Git-Tag: curl-8_3_0~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8dabfb1e1ec98b0d5be9369fc9a9c4b44b2c8cf;p=thirdparty%2Fcurl.git awssiv4: avoid freeing the date pointer on error Since it was not allocated, don't free it even if it was wrong syntax Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=61908 Follow-up to b137634ba3adb Closes #11782 --- diff --git a/lib/http_aws_sigv4.c b/lib/http_aws_sigv4.c index 3abfb096a2..686d26837d 100644 --- a/lib/http_aws_sigv4.c +++ b/lib/http_aws_sigv4.c @@ -220,8 +220,10 @@ static CURLcode make_headers(struct Curl_easy *data, char *value; value = strchr(*date_header, ':'); - if(!value) + if(!value) { + *date_header = NULL; goto fail; + } ++value; while(ISBLANK(*value)) ++value;