From: Kumar Amit Mehta <gmate.amit@gmail.com>
To: neilb@suse.de
Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH] md: md.c: use strlcpy instead of strcpy
Date: Tue, 28 May 2013 02:39:41 -0700 [thread overview]
Message-ID: <1369733981-10679-1-git-send-email-gmate.amit@gmail.com> (raw)
Name of major driver can be of maximum of DISK_NAME_LEN size, therefore
use strlcpy instead of strcpy.
Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com>
---
drivers/md/md.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 0bbe710..9450a2c 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4863,7 +4863,7 @@ static int md_alloc(dev_t dev, char *name)
disk->major = MAJOR(mddev->unit);
disk->first_minor = unit << shift;
if (name)
- strcpy(disk->disk_name, name);
+ strlcpy(disk->disk_name, name, DISK_NAME_LEN);
else if (partitioned)
sprintf(disk->disk_name, "md_d%d", unit);
else
--
1.7.10.4
reply other threads:[~2013-05-28 9:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1369733981-10679-1-git-send-email-gmate.amit@gmail.com \
--to=gmate.amit@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.de \
/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).