minor: within parse_and_store_salt () do the initialization of the buffer at the very start

pull/1091/head
philsmd 7 years ago
parent 33da74f6db
commit e5ecbb9a59
No known key found for this signature in database
GPG Key ID: 4F25D016D9D6A8AF

@ -2041,6 +2041,8 @@ static u32 parse_and_store_salt (u8 *out, u8 *in, u32 salt_len, MAYBE_UNUSED con
return UINT_MAX;
}
memset (tmp, 0, sizeof (tmp_u32));
memcpy (tmp, in, salt_len);
if (hashconfig->opts_type & OPTS_TYPE_ST_HEX)
@ -2070,8 +2072,6 @@ static u32 parse_and_store_salt (u8 *out, u8 *in, u32 salt_len, MAYBE_UNUSED con
salt_len = base64_decode (base64_to_int, (const u8 *) in, salt_len, (u8 *) tmp);
}
memset (tmp + salt_len, 0, sizeof (tmp_u32) - salt_len);
if (hashconfig->opts_type & OPTS_TYPE_ST_UNICODE)
{
if (salt_len < 20)

Loading…
Cancel
Save