All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: ethernet: ti: cpmac.c:  Cleaning up missing null-terminate after strncpy call
@ 2014-08-09 23:41 Rickard Strandqvist
  2014-08-11 19:28 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Rickard Strandqvist @ 2014-08-09 23:41 UTC (permalink / raw)
  To: Florian Fainelli, netdev; +Cc: Rickard Strandqvist, linux-kernel

Added a guaranteed null-terminate after call to strncpy.

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

diff --git a/drivers/net/ethernet/ti/cpmac.c b/drivers/net/ethernet/ti/cpmac.c
index 7399a52..ad268a3 100644
--- a/drivers/net/ethernet/ti/cpmac.c
+++ b/drivers/net/ethernet/ti/cpmac.c
@@ -1125,6 +1125,7 @@ static int cpmac_probe(struct platform_device *pdev)
 		strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE); /* fixed phys bus */
 		phy_id = pdev->id;
 	}
+	mdio_bus_id[sizeof(mdio_bus_id) - 1] = '\0';
 
 	dev = alloc_etherdev_mq(sizeof(*priv), CPMAC_QUEUES);
 	if (!dev)
-- 
1.7.10.4


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

* Re: [PATCH] net: ethernet: ti: cpmac.c: Cleaning up missing null-terminate after strncpy call
  2014-08-09 23:41 [PATCH] net: ethernet: ti: cpmac.c: Cleaning up missing null-terminate after strncpy call Rickard Strandqvist
@ 2014-08-11 19:28 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-08-11 19:28 UTC (permalink / raw)
  To: rickard_strandqvist; +Cc: florian, netdev, linux-kernel

From: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Date: Sun, 10 Aug 2014 01:41:47 +0200

> Added a guaranteed null-terminate after call to strncpy.
> 
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>

Applied.

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

end of thread, other threads:[~2014-08-11 19:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-09 23:41 [PATCH] net: ethernet: ti: cpmac.c: Cleaning up missing null-terminate after strncpy call Rickard Strandqvist
2014-08-11 19:28 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.