crypto: shash - Fix unaligned calculation with short length
commitfce2b77a3f903be6c3cc46de7b850e3fd910bcef
authorYehuda Sadeh <yehuda@hq.newdream.net>
Sat, 4 Apr 2009 04:31:02 +0000 (4 12:31 +0800)
committerChris Wright <chrisw@sous-sol.org>
Mon, 27 Apr 2009 17:36:58 +0000 (27 10:36 -0700)
tree1700a349eabc6907a98c18ceb606c9888b8e90f6
parentdf5b6025d1a9e2e61dde1fd28257082751264c07
crypto: shash - Fix unaligned calculation with short length

upstream commit: f4f689933c63e0fbfba62f2a80efb2b424b139ae

When the total length is shorter than the calculated number of unaligned bytes, the call to shash->update breaks. For example, calling crc32c on unaligned buffer with length of 1 can result in a system crash.

Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
crypto/shash.c