forked from wolfSSL/wolfssl
wolfcrypt/src/sha512.c: fixes for cppcheck complaints: nullPointerRedundantCheck
This commit is contained in:
@@ -956,13 +956,15 @@ int wc_Sha512Update(wc_Sha512* sha512, const byte* data, word32 len)
|
|||||||
|
|
||||||
static WC_INLINE int Sha512Final(wc_Sha512* sha512)
|
static WC_INLINE int Sha512Final(wc_Sha512* sha512)
|
||||||
{
|
{
|
||||||
byte* local = (byte*)sha512->buffer;
|
byte* local;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (sha512 == NULL) {
|
if (sha512 == NULL) {
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local = (byte*)sha512->buffer;
|
||||||
|
|
||||||
local[sha512->buffLen++] = 0x80; /* add 1 */
|
local[sha512->buffLen++] = 0x80; /* add 1 */
|
||||||
|
|
||||||
/* pad with zeros */
|
/* pad with zeros */
|
||||||
|
Reference in New Issue
Block a user