X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=crypto%2Fahash.c;h=96c8e7cb680f4266f5a1470e0de02f885c3c4bbc;hb=0e8f916d7dc9170ab2ef4b9a9ed19b640720029b;hp=ac93c99cfae85abbc7fa433d94ef3fe80437cbb0;hpb=89307babf966165171547f105e2253dec261cfa5;p=pandora-kernel.git diff --git a/crypto/ahash.c b/crypto/ahash.c index ac93c99cfae8..96c8e7cb680f 100644 --- a/crypto/ahash.c +++ b/crypto/ahash.c @@ -404,7 +404,7 @@ static int crypto_ahash_report(struct sk_buff *skb, struct crypto_alg *alg) { struct crypto_report_hash rhash; - snprintf(rhash.type, CRYPTO_MAX_ALG_NAME, "%s", "ahash"); + strncpy(rhash.type, "ahash", sizeof(rhash.type)); rhash.blocksize = alg->cra_blocksize; rhash.digestsize = __crypto_hash_alg_common(alg)->digestsize; @@ -462,7 +462,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;