Netdev List
 help / color / mirror / Atom feed
* [PATCH] usbnet: sanitise overlong driver information strings
@ 2012-06-14 11:18 Phil Sutter
  2012-06-14 19:08 ` Ben Hutchings
  2012-06-17 23:20 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Phil Sutter @ 2012-06-14 11:18 UTC (permalink / raw)
  To: netdev; +Cc: davem

As seen on smsc75xx, driver_info->description being longer than 32
characters messes up 'ethtool -i' output.

Signed-off-by: Phil Sutter <phil.sutter@viprinet.com>
---
 drivers/net/usb/usbnet.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 9f58330..d4f7256 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -876,9 +876,9 @@ void usbnet_get_drvinfo (struct net_device *net, struct ethtool_drvinfo *info)
 {
 	struct usbnet *dev = netdev_priv(net);
 
-	strncpy (info->driver, dev->driver_name, sizeof info->driver);
-	strncpy (info->version, DRIVER_VERSION, sizeof info->version);
-	strncpy (info->fw_version, dev->driver_info->description,
+	strlcpy (info->driver, dev->driver_name, sizeof info->driver);
+	strlcpy (info->version, DRIVER_VERSION, sizeof info->version);
+	strlcpy (info->fw_version, dev->driver_info->description,
 		sizeof info->fw_version);
 	usb_make_path (dev->udev, info->bus_info, sizeof info->bus_info);
 }
-- 
1.7.3.4

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

end of thread, other threads:[~2012-06-17 23:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-14 11:18 [PATCH] usbnet: sanitise overlong driver information strings Phil Sutter
2012-06-14 19:08 ` Ben Hutchings
2012-06-17 23:20 ` David Miller

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