netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: ethernet: marvell: sky2.c:  Cleaning up missing null-terminate in conjunction with strncpy
@ 2014-09-14 17:33 Rickard Strandqvist
  2014-09-15  2:05 ` Stephen Hemminger
  2014-09-15  3:19 ` Stephen Hemminger
  0 siblings, 2 replies; 7+ messages in thread
From: Rickard Strandqvist @ 2014-09-14 17:33 UTC (permalink / raw)
  To: Mirko Lindner, Stephen Hemminger
  Cc: Rickard Strandqvist, netdev, linux-kernel

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

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/net/ethernet/marvell/sky2.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
index dba48a5c..7053d38 100644
--- a/drivers/net/ethernet/marvell/sky2.c
+++ b/drivers/net/ethernet/marvell/sky2.c
@@ -4907,7 +4907,7 @@ static const char *sky2_name(u8 chipid, char *buf, int sz)
 	};
 
 	if (chipid >= CHIP_ID_YUKON_XL && chipid <= CHIP_ID_YUKON_OP_2)
-		strncpy(buf, name[chipid - CHIP_ID_YUKON_XL], sz);
+		strlcpy(buf, name[chipid - CHIP_ID_YUKON_XL], sz);
 	else
 		snprintf(buf, sz, "(chip %#x)", chipid);
 	return buf;
-- 
1.7.10.4

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

end of thread, other threads:[~2014-10-14 22:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-14 17:33 [PATCH] net: ethernet: marvell: sky2.c: Cleaning up missing null-terminate in conjunction with strncpy Rickard Strandqvist
2014-09-15  2:05 ` Stephen Hemminger
2014-09-15 17:07   ` David Miller
2014-09-15 20:53     ` Stephen Hemminger
2014-09-15 20:56       ` David Miller
2014-10-14 22:11         ` Rickard Strandqvist
2014-09-15  3:19 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).