netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] team: use strlcpy with ethtool_drvinfo fields
@ 2013-01-05 12:53 Flavio Leitner
  2013-01-05 13:17 ` Jiri Pirko
  2013-01-05 14:11 ` Ben Hutchings
  0 siblings, 2 replies; 4+ messages in thread
From: Flavio Leitner @ 2013-01-05 12:53 UTC (permalink / raw)
  To: netdev; +Cc: Ben Hutchings, Jiri Pirko, Flavio Leitner

The fields must be null-terminated.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
---
 drivers/net/team/team.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index 78c7d87..e27ac5c 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -1747,8 +1747,8 @@ static const struct net_device_ops team_netdev_ops = {
 static void team_ethtool_get_drvinfo(struct net_device *dev,
 				     struct ethtool_drvinfo *drvinfo)
 {
-	strncpy(drvinfo->driver, DRV_NAME, 32);
-	strncpy(drvinfo->version, UTS_RELEASE, 32);
+	strlcpy(drvinfo->driver, DRV_NAME, sizeof(drvinfo->driver));
+	strlcpy(drvinfo->version, UTS_RELEASE, sizeof(drvinfo->version));
 }
 
 static const struct ethtool_ops team_ethtool_ops = {
-- 
1.8.0.1

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

end of thread, other threads:[~2013-01-07  5:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-05 12:53 [PATCH net-next] team: use strlcpy with ethtool_drvinfo fields Flavio Leitner
2013-01-05 13:17 ` Jiri Pirko
2013-01-05 14:11 ` Ben Hutchings
2013-01-07  5:12   ` David Miller

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