From 80a5a11bb13e572d05d197526e243c5889ddf39e Mon Sep 17 00:00:00 2001 From: Vincent JARDIN Date: Wed, 27 Sep 2017 23:29:49 +0200 Subject: [PATCH] sha256: fix clang warning t0 and t1 are not used, but want do really want them to be reset to secure the stack. Suggested by Quentin: let's use memset() to be consistent. --- lib/sha256.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/sha256.c b/lib/sha256.c index a1b77901ee..e902021545 100644 --- a/lib/sha256.c +++ b/lib/sha256.c @@ -192,7 +192,8 @@ static void SHA256_Transform(uint32_t *state, const unsigned char block[64]) /* Clean the stack. */ memset(W, 0, 256); memset(S, 0, 32); - t0 = t1 = 0; + memset(t0, 0, sizeof(t0)); + memset(t1, 0, sizeof(t0)); } static unsigned char PAD[64] = { -- 2.39.5