summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/lib/vauth
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-10-22 16:55:14 (GMT)
committerBrad King <brad.king@kitware.com>2018-10-22 16:55:14 (GMT)
commitec13ba36b5398f1d561d6e72d8e253d0eb3c2b5e (patch)
treebeb2cf13c007254d5daefa4bd929ce70520e890c /Utilities/cmcurl/lib/vauth
parent8b5cd17000a6fcf3cf9637c4a5048a7a91fc68e3 (diff)
parent031002456381245f88f64b0826798b1e249e8e39 (diff)
downloadCMake-ec13ba36b5398f1d561d6e72d8e253d0eb3c2b5e.zip
CMake-ec13ba36b5398f1d561d6e72d8e253d0eb3c2b5e.tar.gz
CMake-ec13ba36b5398f1d561d6e72d8e253d0eb3c2b5e.tar.bz2
Merge branch 'update-curl' into release-3.13
Merge-request: !2509
Diffstat (limited to 'Utilities/cmcurl/lib/vauth')
-rw-r--r--Utilities/cmcurl/lib/vauth/digest.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Utilities/cmcurl/lib/vauth/digest.c b/Utilities/cmcurl/lib/vauth/digest.c
index 131d9da..cc6f169 100644
--- a/Utilities/cmcurl/lib/vauth/digest.c
+++ b/Utilities/cmcurl/lib/vauth/digest.c
@@ -158,7 +158,7 @@ static void auth_digest_sha256_to_ascii(unsigned char *source, /* 32 bytes */
/* Perform quoted-string escaping as described in RFC2616 and its errata */
static char *auth_digest_string_quoted(const char *source)
{
- char *dest, *d;
+ char *dest;
const char *s = source;
size_t n = 1; /* null terminator */
@@ -173,8 +173,8 @@ static char *auth_digest_string_quoted(const char *source)
dest = malloc(n);
if(dest) {
+ char *d = dest;
s = source;
- d = dest;
while(*s) {
if(*s == '"' || *s == '\\') {
*d++ = '\\';
@@ -696,7 +696,6 @@ static CURLcode _Curl_auth_create_digest_http_message(
unsigned char ha1[65]; /* 64 digits and 1 zero byte */
unsigned char ha2[65]; /* 64 digits and 1 zero byte */
char userh[65];
- char cnoncebuf[33];
char *cnonce = NULL;
size_t cnonce_sz = 0;
char *userp_quoted;
@@ -707,6 +706,7 @@ static CURLcode _Curl_auth_create_digest_http_message(
digest->nc = 1;
if(!digest->cnonce) {
+ char cnoncebuf[33];
result = Curl_rand_hex(data, (unsigned char *)cnoncebuf,
sizeof(cnoncebuf));
if(result)