diff options
author | Sebastian Siewior <sebastian@breakpoint.cc> | 2007-08-03 14:33:47 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2007-08-06 09:33:56 +0200 |
commit | 06817176784f620984200dc5d7cbe16984f7b262 (patch) | |
tree | 42de1788711cff6832c99a4f6a6518bb4f316935 /crypto/hash.c | |
parent | Linux 2.6.23-rc2 (diff) | |
download | linux-06817176784f620984200dc5d7cbe16984f7b262.tar.xz linux-06817176784f620984200dc5d7cbe16984f7b262.zip |
[CRYPTO] api: fix writting into unallocated memory in setkey_aligned
setkey_unaligned() commited in ca7c39385ce1a7b44894a4b225a4608624e90730
overwrites unallocated memory in the following memset() because
I used the wrong buffer length.
Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/hash.c')
-rw-r--r-- | crypto/hash.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/hash.c b/crypto/hash.c index 4d75ca7b57b2..4fd470bd729b 100644 --- a/crypto/hash.c +++ b/crypto/hash.c @@ -40,7 +40,7 @@ static int hash_setkey_unaligned(struct crypto_hash *crt, const u8 *key, alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1); memcpy(alignbuffer, key, keylen); ret = alg->setkey(crt, alignbuffer, keylen); - memset(alignbuffer, 0, absize); + memset(alignbuffer, 0, keylen); kfree(buffer); return ret; } |