From: Flavio Leitner Date: Sat, 5 Jan 2013 02:53:10 +0000 (+0000) Subject: team: use strlcpy with ethtool_drvinfo fields X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3066af582fd8084d9767ee8a71b8778360813106;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git team: use strlcpy with ethtool_drvinfo fields The fields must be null-terminated. Signed-off-by: Flavio Leitner Acked-by: Jiri Pirko Acked-by: Ben Hutchings Signed-off-by: David S. Miller --- diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index 250f8c1df72c..70d5d6bdf583 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 = {