1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-16 04:49:24 +00:00

Merge pull request #1064 from philsmd/master

minor: use memset () before memcpy () in cpu MD5 function
This commit is contained in:
Jens Steube 2017-02-14 13:24:00 +01:00 committed by GitHub
commit 1353a727b8

View File

@ -155,12 +155,14 @@ void md5_complete_no_limit (u32 digest[4], u32 *plain, u32 plain_len)
int cur_len = MIN (block_total_len, remaining_len);
int copy_len = MAX (cur_len, 0); // should never be negative of course
// initialize the block
memset (block_ptr, 0, block_total_len);
// copy the bytes from the plain pointer (plain_ptr)
memcpy (block_ptr, plain_ptr, (size_t) copy_len);
// clear the remaining bytes of the block
memset (block_ptr + copy_len, 0, (size_t) block_total_len - (size_t) copy_len);
/*
* final block
*/