summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXiao Ni <xni@redhat.com>2024-07-26 09:14:10 +0200
committerMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>2024-08-05 11:13:04 +0200
commitdebf421db02c85f176b5eda2e8dcc9d17d89623c (patch)
tree03388f03c82a08a9512adb409458077ee6527d66
parentmdadm/mdopen: fix coverity issue CHECKED_RETURN (diff)
downloadmdadm-debf421db02c85f176b5eda2e8dcc9d17d89623c.tar.xz
mdadm-debf421db02c85f176b5eda2e8dcc9d17d89623c.zip
mdadm/mdopen: fix coverity issue STRING_OVERFLOW
Fix string overflow problems in mdopen.c Signed-off-by: Xiao Ni <xni@redhat.com> Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
-rw-r--r--mdopen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mdopen.c b/mdopen.c
index c9fda131..e49defb6 100644
--- a/mdopen.c
+++ b/mdopen.c
@@ -376,7 +376,7 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
sprintf(devname, "/dev/%s", devnm);
- if (dev && dev[0] == '/')
+ if (dev && dev[0] == '/' && strlen(dev) < 400)
strcpy(chosen, dev);
else if (cname[0] == 0)
strcpy(chosen, devname);