team: use strlcpy with ethtool_drvinfo fields
authorFlavio Leitner <fbl@redhat.com>
Sat, 5 Jan 2013 02:53:10 +0000 (02:53 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 7 Jan 2013 05:12:25 +0000 (21:12 -0800)
The fields must be null-terminated.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
Acked-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/team/team.c

index 250f8c1df72c7d3cad3e1573448d4785cd08cf61..70d5d6bdf583c3defdb6ca43080e69724cbcf289 100644 (file)
@@ -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 = {