crypto: ahash - ensure statesize is non-zero
[pandora-kernel.git] / crypto / blkcipher.c
index 1e61d1a..04f0f38 100644 (file)
@@ -499,9 +499,9 @@ static int crypto_blkcipher_report(struct sk_buff *skb, struct crypto_alg *alg)
 {
        struct crypto_report_blkcipher rblkcipher;
 
-       snprintf(rblkcipher.type, CRYPTO_MAX_ALG_NAME, "%s", "blkcipher");
-       snprintf(rblkcipher.geniv, CRYPTO_MAX_ALG_NAME, "%s",
-                alg->cra_blkcipher.geniv ?: "<default>");
+       strncpy(rblkcipher.type, "blkcipher", sizeof(rblkcipher.type));
+       strncpy(rblkcipher.geniv, alg->cra_blkcipher.geniv ?: "<default>",
+               sizeof(rblkcipher.geniv));
 
        rblkcipher.blocksize = alg->cra_blocksize;
        rblkcipher.min_keysize = alg->cra_blkcipher.min_keysize;