* [PATCH] md: md.c: use strlcpy instead of strcpy
@ 2013-05-28 9:39 Kumar Amit Mehta
0 siblings, 0 replies; only message in thread
From: Kumar Amit Mehta @ 2013-05-28 9:39 UTC (permalink / raw)
To: neilb; +Cc: linux-raid, linux-kernel, kernel-janitors
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-05-28 9:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-28 9:39 [PATCH] md: md.c: use strlcpy instead of strcpy Kumar Amit Mehta
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).