summaryrefslogtreecommitdiffstats
path: root/mdopen.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-11-01 04:09:40 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-11-01 04:09:40 +0000
commit256f011d2f256c8c2c05c37a518401199fa423bf (patch)
tree8dc9f04b281a2a8d080f0f327d11f33846be8e33 /mdopen.c
parentReleasing debian version 4.2+20230508-7. (diff)
downloadmdadm-256f011d2f256c8c2c05c37a518401199fa423bf.tar.xz
mdadm-256f011d2f256c8c2c05c37a518401199fa423bf.zip
Merging upstream version 4.2+20231026.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mdopen.c')
-rw-r--r--mdopen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mdopen.c b/mdopen.c
index d3022a5..3daa71f 100644
--- a/mdopen.c
+++ b/mdopen.c
@@ -193,14 +193,14 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
if (dev) {
if (strncmp(dev, DEV_MD_DIR, DEV_MD_DIR_LEN) == 0) {
- strcpy(cname, dev + DEV_MD_DIR_LEN);
+ snprintf(cname, MD_NAME_MAX, "%s", dev + DEV_MD_DIR_LEN);
} else if (strncmp(dev, "/dev/", 5) == 0) {
char *e = dev + strlen(dev);
while (e > dev && isdigit(e[-1]))
e--;
if (e[0])
num = strtoul(e, NULL, 10);
- strcpy(cname, dev+5);
+ snprintf(cname, MD_NAME_MAX, "%s", dev + 5);
cname[e-(dev+5)] = 0;
/* name *must* be mdXX or md_dXX in this context */
if (num < 0 ||