linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: can: usb: peak_usb: pcan_usb_core.c:  Cleaning up missing null-terminate in conjunction with strncpy
@ 2014-09-14 17:31 Rickard Strandqvist
  2014-09-15  8:01 ` Stephane Grosjean
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Rickard Strandqvist @ 2014-09-14 17:31 UTC (permalink / raw)
  To: Wolfgang Grandegger, Marc Kleine-Budde
  Cc: Rickard Strandqvist, Oliver Hartkopp, Stephane Grosjean,
	Alexey Khoroshilov, Christopher R. Baker, linux-can, 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/can/usb/peak_usb/pcan_usb_core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
index 644e6ab..d4fe8ac 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
@@ -830,7 +830,7 @@ static void peak_usb_disconnect(struct usb_interface *intf)
 		char name[IFNAMSIZ];
 
 		dev->state &= ~PCAN_USB_STATE_CONNECTED;
-		strncpy(name, netdev->name, IFNAMSIZ);
+		strlcpy(name, netdev->name, IFNAMSIZ);
 
 		unregister_netdev(netdev);
 		free_candev(netdev);
-- 
1.7.10.4


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

end of thread, other threads:[~2014-09-16 14:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-14 17:31 [PATCH] net: can: usb: peak_usb: pcan_usb_core.c: Cleaning up missing null-terminate in conjunction with strncpy Rickard Strandqvist
2014-09-15  8:01 ` Stephane Grosjean
2014-09-15  8:28 ` David Laight
2014-09-15  8:42   ` Marc Kleine-Budde
2014-09-15  8:47     ` David Laight
2014-09-15 21:47       ` Rickard Strandqvist
2014-09-16  8:40         ` David Laight
2014-09-16 14:09 ` Marc Kleine-Budde

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).