team: use strlcpy with ethtool_drvinfo fields
authorFlavio Leitner <[email protected]>
Sat, 5 Jan 2013 02:53:10 +0000 (02:53 +0000)
committerDavid S. Miller <[email protected]>
Mon, 7 Jan 2013 05:12:25 +0000 (21:12 -0800)
The fields must be null-terminated.

Signed-off-by: Flavio Leitner <[email protected]>
Acked-by: Jiri Pirko <[email protected]>
Acked-by: Ben Hutchings <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
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 = {