From: Vsevolod Stakhov Date: Mon, 18 Jul 2016 14:35:41 +0000 (+0100) Subject: [Fix] Fix border cases for incremental hashing X-Git-Tag: 1.3.0~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8648640248246880e83af6b2cde24fde1f4b1c5b;p=thirdparty%2Frspamd.git [Fix] Fix border cases for incremental hashing --- diff --git a/src/libcryptobox/cryptobox.c b/src/libcryptobox/cryptobox.c index 08ae1fd8fc..9e2d4b9cd3 100644 --- a/src/libcryptobox/cryptobox.c +++ b/src/libcryptobox/cryptobox.c @@ -1449,6 +1449,7 @@ rspamd_cryptobox_fast_hash_update (rspamd_cryptobox_fast_hash_state_t *st, len -= n; rst->h = mum_hash_step (rst->h, rst->buf); rst->buf = 0; + rst->pos = 0; } while (len > 8) { @@ -1482,7 +1483,7 @@ rspamd_cryptobox_fast_hash_final (rspamd_cryptobox_fast_hash_state_t *st) rst->h = mum_hash_step (rst->h, rst->buf); } - return rst->h; + return mum_hash_finish (rst->h); } /**