From 82b508b9171c945ba881101e2e31912e53189a35 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Sat, 8 Jan 2022 00:32:26 -0600 Subject: [PATCH] wolfcrypt/src/sha512.c: fixes for cppcheck complaints: nullPointerRedundantCheck --- wolfcrypt/src/sha512.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/sha512.c b/wolfcrypt/src/sha512.c index a84c3943a..a0a0b3b4a 100644 --- a/wolfcrypt/src/sha512.c +++ b/wolfcrypt/src/sha512.c @@ -956,13 +956,15 @@ int wc_Sha512Update(wc_Sha512* sha512, const byte* data, word32 len) static WC_INLINE int Sha512Final(wc_Sha512* sha512) { - byte* local = (byte*)sha512->buffer; + byte* local; int ret; if (sha512 == NULL) { return BAD_FUNC_ARG; } + local = (byte*)sha512->buffer; + local[sha512->buffLen++] = 0x80; /* add 1 */ /* pad with zeros */