Skip to content

Commit 9430c8a

Browse files
Merge pull request #9003 from embhorn/cov_531298
Fix blake2b_final coverity reports
2 parents 2c341a5 + 9c2ea12 commit 9430c8a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wolfcrypt/src/blake2b.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,9 @@ int blake2b_final( blake2b_state *S, byte *out, byte outlen )
356356
}
357357

358358
S->buflen -= BLAKE2B_BLOCKBYTES;
359-
if ( S->buflen >= (BLAKE2B_BLOCKBYTES * 2) )
359+
if ( S->buflen > BLAKE2B_BLOCKBYTES )
360360
return BAD_LENGTH_E;
361-
XMEMCPY( S->buf, S->buf + BLAKE2B_BLOCKBYTES, (wolfssl_word)S->buflen );
361+
XMEMMOVE( S->buf, S->buf + BLAKE2B_BLOCKBYTES, (wolfssl_word)S->buflen );
362362
}
363363

364364
blake2b_increment_counter( S, S->buflen );

0 commit comments

Comments
 (0)