From 466fa2adbf4d2a74059a21471ddc47416c3f9c7d Mon Sep 17 00:00:00 2001 From: Dmitry Podgorny Date: Sun, 10 Nov 2019 16:00:48 +0200 Subject: [PATCH] sha1: don't clean local variable i on exit In this place value of variable i is constant and predictable. No point to clean it. Furthermore, since the value is not used after assignment, compiler will optimize and remove the assignment. This patch fixes a warning from the clang static analyzer. --- src/sha1.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/sha1.c b/src/sha1.c index a1cbaae..ada1017 100644 --- a/src/sha1.c +++ b/src/sha1.c @@ -234,7 +234,6 @@ void crypto_SHA1_Final(SHA1_CTX* context, uint8_t* digest) } /* Wipe variables */ - i = 0; memset(context->buffer, 0, 64); memset(context->state, 0, 20); memset(context->count, 0, 8);