From: Edgar E. Iglesias Date: Sat, 6 Apr 2013 09:30:10 +0000 (+0200) Subject: Fix condition for when the block buffer is full. X-Git-Tag: nettle_2.7_release_20130424~65^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e76c8b47fb4e813fc4d3b11c3e35ef12a69f794b;p=thirdparty%2Fnettle.git Fix condition for when the block buffer is full. --- diff --git a/ChangeLog b/ChangeLog index ad89c2ec..09a744f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-04-06 Niels Möller + + From Edgar E. Iglesias: + * sha3.c (_sha3_update): Fix condition for when the block buffer + is full. + 2013-04-04 Niels Möller * ecc-point.c (ecc_point_get): Allow NULL x or y, ignore diff --git a/sha3.c b/sha3.c index d7aec46e..21e7beb7 100644 --- a/sha3.c +++ b/sha3.c @@ -61,7 +61,7 @@ _sha3_update (struct sha3_state *state, if (pos > 0) { unsigned left = block_size - pos; - if (length < pos) + if (length < left) { memcpy (block + pos, data, length); return pos + length;