From: Tilman Sauerbeck Date: Mon, 1 Jan 2018 11:18:58 +0000 (+0100) Subject: Initialize final byte of cryptState_t::decrypt_history, too. X-Git-Url: http://git.code-monkey.de/?p=umurmur.git;a=commitdiff_plain;h=00137368a0955dc05c38b122971cae555689267f Initialize final byte of cryptState_t::decrypt_history, too. This fixes an off-by-one error in CryptState_init() which would leave the final byte of decrypt_history uninitialized. --- diff --git a/src/crypt.c b/src/crypt.c index 4b1b4f4..b5e07b1 100644 --- a/src/crypt.c +++ b/src/crypt.c @@ -52,7 +52,7 @@ static void CryptState_ocb_decrypt(cryptState_t *cs, const unsigned char *encryp void CryptState_init(cryptState_t *cs) { - memset(cs->decrypt_history, 0, 0xff); + memset(cs->decrypt_history, 0, sizeof(cs->decrypt_history)); memset(cs->raw_key, 0, AES_BLOCK_SIZE); memset(cs->encrypt_iv, 0, AES_BLOCK_SIZE); memset(cs->decrypt_iv, 0, AES_BLOCK_SIZE);