From: Flavio Leitner <fbl@redhat.com>
To: netdev <netdev@vger.kernel.org>
Cc: Ben Hutchings <bhutchings@solarflare.com>,
Jiri Pirko <jpirko@redhat.com>, Flavio Leitner <fbl@redhat.com>
Subject: [PATCH net-next] team: use strlcpy with ethtool_drvinfo fields
Date: Sat, 5 Jan 2013 10:53:10 -0200 [thread overview]
Message-ID: <1357390390-16549-1-git-send-email-fbl@redhat.com> (raw)
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
next reply other threads:[~2013-01-05 12:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-05 12:53 Flavio Leitner [this message]
2013-01-05 13:17 ` [PATCH net-next] team: use strlcpy with ethtool_drvinfo fields Jiri Pirko
2013-01-05 14:11 ` Ben Hutchings
2013-01-07 5:12 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1357390390-16549-1-git-send-email-fbl@redhat.com \
--to=fbl@redhat.com \
--cc=bhutchings@solarflare.com \
--cc=jpirko@redhat.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).