aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorPhil Sutter <phil.sutter@viprinet.com>2012-06-13 21:18:42 -0400
committerDavid S. Miller <davem@davemloft.net>2012-06-17 19:20:31 -0400
commit86a2f415e6cdc5dbb2163b31abf4d36f26f7e3da (patch)
treedeb47e0b1e7a5596e0faae054584188dd14303a9 /drivers/net
parent0b3f0e7ae0765c81c7d659811595ea5058ae05a7 (diff)
usbnet: sanitise overlong driver information strings
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/usb/usbnet.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 9f58330f131..d4f7256a607 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)
876{ 876{
877 struct usbnet *dev = netdev_priv(net); 877 struct usbnet *dev = netdev_priv(net);
878 878
879 strncpy (info->driver, dev->driver_name, sizeof info->driver); 879 strlcpy (info->driver, dev->driver_name, sizeof info->driver);
880 strncpy (info->version, DRIVER_VERSION, sizeof info->version); 880 strlcpy (info->version, DRIVER_VERSION, sizeof info->version);
881 strncpy (info->fw_version, dev->driver_info->description, 881 strlcpy (info->fw_version, dev->driver_info->description,
882 sizeof info->fw_version); 882 sizeof info->fw_version);
883 usb_make_path (dev->udev, info->bus_info, sizeof info->bus_info); 883 usb_make_path (dev->udev, info->bus_info, sizeof info->bus_info);
884} 884}