1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-03-24 11:25:41 +00:00

minor: use memset () before memcpy () in cpu MD5 function

This commit is contained in:
philsmd 2017-02-14 13:21:11 +01:00
parent 521c819842
commit 5612e721b8
No known key found for this signature in database
GPG Key ID: 4F25D016D9D6A8AF

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