Fixed unterminated salt buffer in -m 23400 module_hash_encode() in case salt was of length 256

This commit is contained in:
Jens Steube
2021-05-11 23:36:31 +02:00
parent a2fcb03fe3
commit 4221bd151c
2 changed files with 4 additions and 3 deletions
+3 -3
View File
@@ -201,11 +201,11 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt_buf
#define SALT_LEN_BASE64 ((SALT_MAX * 8) / 6) + 3
u8 salt_buf[SALT_MAX * 2];
u8 salt_buf[SALT_LEN_BASE64] = { 0 };
const int salt_len = base64_encode (int_to_base64, (const u8 *) salt->salt_buf, (const int) salt->salt_len, salt_buf);
base64_encode (int_to_base64, (const u8 *) salt->salt_buf, (const int) salt->salt_len, salt_buf);
salt_buf[salt_len] = 0;
// hash_buf