From e5ecbb9a5901e3ea8812e4701b19aa9586e94b63 Mon Sep 17 00:00:00 2001 From: philsmd Date: Tue, 14 Feb 2017 19:30:36 +0100 Subject: [PATCH] minor: within parse_and_store_salt () do the initialization of the buffer at the very start --- src/interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interface.c b/src/interface.c index 29072887f..ff00b4996 100644 --- a/src/interface.c +++ b/src/interface.c @@ -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)