mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] crypto: rng.c:  Cleaning up missing null-terminate in conjunction with strncpy
@ 2014-07-26 14:18 Rickard Strandqvist
  2014-07-27  2:35 ` Mark D Rustad
  0 siblings, 1 reply; 3+ messages in thread
From: Rickard Strandqvist @ 2014-07-26 14:18 UTC (permalink / raw)
  To: Neil Horman, Herbert Xu
  Cc: Rickard Strandqvist, David S. Miller, linux-crypto, linux-kernel

Replacing strncpy with strlcpy to avoid strings that lacks null terminate.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 crypto/rng.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/rng.c b/crypto/rng.c
index e0a25c2..c3d4fb3 100644
--- a/crypto/rng.c
+++ b/crypto/rng.c
@@ -65,7 +65,7 @@ static int crypto_rng_report(struct sk_buff *skb, struct crypto_alg *alg)
 {
 	struct crypto_report_rng rrng;
 
-	strncpy(rrng.type, "rng", sizeof(rrng.type));
+	strlcpy(rrng.type, "rng", sizeof(rrng.type));
 
 	rrng.seedsize = alg->cra_rng.seedsize;
 
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-07-27 12:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-26 14:18 [PATCH] crypto: rng.c: Cleaning up missing null-terminate in conjunction with strncpy Rickard Strandqvist
2014-07-27  2:35 ` Mark D Rustad
2014-07-27 12:14   ` Rickard Strandqvist

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®