summaryrefslogtreecommitdiff
path: root/crypto/blkcipher.c
diff options
context:
space:
mode:
authorSebastian Siewior <sebastian@breakpoint.cc>2007-08-03 20:33:47 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2007-08-06 15:33:56 +0800
commita37620a6dacd79bc1a6ebbc581f651eee93f2945 (patch)
tree89340f60a59607aa2e8fd5b1fe186a69d32ee257 /crypto/blkcipher.c
parent78d0c00fcda93504709987ef0a4560705e04079d (diff)
downloadlinux-crypto-a37620a6dacd79bc1a6ebbc581f651eee93f2945.tar.gz
linux-crypto-a37620a6dacd79bc1a6ebbc581f651eee93f2945.zip
[CRYPTO] api: fix writting into unallocated memory in setkey_aligned
setkey_unaligned() commited in 20b25bb420c3a03443b1ebf62c2228a9f923bd3a 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/blkcipher.c')
-rw-r--r--crypto/blkcipher.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/blkcipher.c b/crypto/blkcipher.c
index 40a3dcff..7755834b 100644
--- a/crypto/blkcipher.c
+++ b/crypto/blkcipher.c
@@ -352,7 +352,7 @@ static int setkey_unaligned(struct crypto_tfm *tfm, const u8 *key, unsigned int
alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1);
memcpy(alignbuffer, key, keylen);
ret = cipher->setkey(tfm, alignbuffer, keylen);
- memset(alignbuffer, 0, absize);
+ memset(alignbuffer, 0, keylen);
kfree(buffer);
return ret;
}