wolfcrypt/src/sha512.c: fixes for cppcheck complaints: nullPointerRedundantCheck

This commit is contained in:
Daniel Pouzzner
2022-01-08 00:32:26 -06:00
parent 6e763825ed
commit 82b508b917

View File

@@ -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 */