X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=crypto%2Fcipher.c;h=cdcf3472e9af3773148d6cbfae54757edb949dba;hb=9c920a8402f2bb9bd931801d429b65f4eb6a262b;hp=6ab56eb3502c89f1f3b790e22b96ddfdad710cf9;hpb=a91482bdcc2e0f6035702e46f1b99043a0893346;p=linux-2.6.git diff --git a/crypto/cipher.c b/crypto/cipher.c index 6ab56eb35..cdcf3472e 100644 --- a/crypto/cipher.c +++ b/crypto/cipher.c @@ -52,8 +52,8 @@ static int crypt(struct crypto_tfm *tfm, { struct scatter_walk walk_in, walk_out; const unsigned int bsize = crypto_tfm_alg_blocksize(tfm); - u8 tmp_src[bsize]; - u8 tmp_dst[bsize]; + u8 tmp_src[nbytes > src->length ? bsize : 0]; + u8 tmp_dst[nbytes > dst->length ? bsize : 0]; if (!nbytes) return 0;