X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=crypto%2Fahash.c;h=9c1dc8d6106a89a0f853271c1dfc49cd301ec983;hb=199c6550694dcdf5f568ea9db6fe2b46d14e4fa5;hp=8acb886032ae7a604fe0e965eb5d3ce07dd4845b;hpb=af6b7a82fd2416d68bcf46d18d96de9b59e43b06;p=firefly-linux-kernel-4.4.55.git diff --git a/crypto/ahash.c b/crypto/ahash.c index 8acb886032ae..9c1dc8d6106a 100644 --- a/crypto/ahash.c +++ b/crypto/ahash.c @@ -544,7 +544,8 @@ static int ahash_prepare_alg(struct ahash_alg *alg) struct crypto_alg *base = &alg->halg.base; if (alg->halg.digestsize > PAGE_SIZE / 8 || - alg->halg.statesize > PAGE_SIZE / 8) + alg->halg.statesize > PAGE_SIZE / 8 || + alg->halg.statesize == 0) return -EINVAL; base->cra_type = &crypto_ahash_type;