From c58a0a6b329100b258e43c79aa4ea10f962bc47e Mon Sep 17 00:00:00 2001 From: Jiri Pirko Date: Thu, 14 Mar 2013 17:36:37 -0700 Subject: [PATCH] datapath: fix drvinfo strings set in drivers Use strlcpy where possible to ensure the string is \0 terminated. Use always sizeof(string) instead of 32, ETHTOOL_BUSINFO_LEN and custom defines. Use snprintf instead of sprint. Remove unnecessary inits of ->fw_version Remove unnecessary inits of drvinfo struct. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller Signed-off-by: Jesse Gross --- datapath/vport-internal_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datapath/vport-internal_dev.c b/datapath/vport-internal_dev.c index a5f2d757f..78f1a5265 100644 --- a/datapath/vport-internal_dev.c +++ b/datapath/vport-internal_dev.c @@ -115,7 +115,7 @@ static int internal_dev_stop(struct net_device *netdev) static void internal_dev_getinfo(struct net_device *netdev, struct ethtool_drvinfo *info) { - strcpy(info->driver, "openvswitch"); + strlcpy(info->driver, "openvswitch", sizeof(info->driver)); } static const struct ethtool_ops internal_dev_ethtool_ops = { -- 2.43.0