提交 3066af58 编写于 作者: F Flavio Leitner 提交者: David S. Miller

team: use strlcpy with ethtool_drvinfo fields

The fields must be null-terminated.
Signed-off-by: NFlavio Leitner <fbl@redhat.com>
Acked-by: NJiri Pirko <jiri@resnulli.us>
Acked-by: NBen Hutchings <bhutchings@solarflare.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 5d134f1c
...@@ -1747,8 +1747,8 @@ static const struct net_device_ops team_netdev_ops = { ...@@ -1747,8 +1747,8 @@ static const struct net_device_ops team_netdev_ops = {
static void team_ethtool_get_drvinfo(struct net_device *dev, static void team_ethtool_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *drvinfo) struct ethtool_drvinfo *drvinfo)
{ {
strncpy(drvinfo->driver, DRV_NAME, 32); strlcpy(drvinfo->driver, DRV_NAME, sizeof(drvinfo->driver));
strncpy(drvinfo->version, UTS_RELEASE, 32); strlcpy(drvinfo->version, UTS_RELEASE, sizeof(drvinfo->version));
} }
static const struct ethtool_ops team_ethtool_ops = { static const struct ethtool_ops team_ethtool_ops = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册