]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
sha256: fixed potentially uninitialized variable
authorSiva Sivaraman <kasivara@microsoft.com>
Mon, 18 May 2020 15:59:31 +0000 (08:59 -0700)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 19 May 2020 06:47:12 +0000 (08:47 +0200)
Closes #5414

lib/sha256.c

index a3be92a4eb5ec2c2ddb54ef539d66cfe52e1434f..aebcc55b22899bd0f3117a71ebe7a4f0b1ae130f 100644 (file)
@@ -224,6 +224,7 @@ static void SHA256_Update(SHA256_CTX *ctx,
 static void SHA256_Final(unsigned char *digest, SHA256_CTX *ctx)
 {
   unsigned long length;
+  length = 0;
 
   CryptGetHashParam(ctx->hHash, HP_HASHVAL, NULL, &length, 0);
   if(length == SHA256_DIGEST_LENGTH)