diff options
author | Robert LeBlanc <robert@leblancnet.us> | 2016-08-24 18:10:44 +0200 |
---|---|---|
committer | Jes Sorensen <Jes.Sorensen@redhat.com> | 2016-08-25 19:43:31 +0200 |
commit | bd1fd72e13652416da4c646ea47549fcfdf49b26 (patch) | |
tree | eb048de990a99b3332e717b785fe41cba48d6231 /mdopen.c | |
parent | bitmap: Mark a number of local functions static (diff) | |
download | mdadm-bd1fd72e13652416da4c646ea47549fcfdf49b26.tar.xz mdadm-bd1fd72e13652416da4c646ea47549fcfdf49b26.zip |
mdopen: Prevent overrunning the devname buffer when copying devnm into it for long md names.
Linux allows for 32 character device names. When using the maximum
size device name and also storing "/dev/", devname needs to be 37
character long to store the complete device name.
i.e. "/dev/md_abcdefghijklmnopqrstuvwxyz12\0"
Signed-off-by: Robert LeBlanc<robert@leblancnet.us>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Diffstat (limited to 'mdopen.c')
-rw-r--r-- | mdopen.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -144,7 +144,7 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy, struct createinfo *ci = conf_get_create_info(); int parts; char *cname; - char devname[20]; + char devname[37]; char devnm[32]; char cbuf[400]; if (chosen == NULL) |