diff options
Diffstat (limited to 'crypto/rng.c')
| -rw-r--r-- | crypto/rng.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/rng.c b/crypto/rng.c index 64f864fa804..e0a25c2456d 100644 --- a/crypto/rng.c +++ b/crypto/rng.c @@ -65,13 +65,13 @@ static int crypto_rng_report(struct sk_buff *skb, struct crypto_alg *alg) { struct crypto_report_rng rrng; - snprintf(rrng.type, CRYPTO_MAX_ALG_NAME, "%s", "rng"); + strncpy(rrng.type, "rng", sizeof(rrng.type)); rrng.seedsize = alg->cra_rng.seedsize; - NLA_PUT(skb, CRYPTOCFGA_REPORT_RNG, - sizeof(struct crypto_report_rng), &rrng); - + if (nla_put(skb, CRYPTOCFGA_REPORT_RNG, + sizeof(struct crypto_report_rng), &rrng)) + goto nla_put_failure; return 0; nla_put_failure: |
