1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

cov: index off by one

Basically apply stable patch fdb6ef8a85 to internal libdm version.
This commit is contained in:
Zdenek Kabelac 2018-10-15 14:43:25 +02:00
parent 2ab784440a
commit 77aa055e8a

View File

@ -1765,7 +1765,7 @@ static int _mountinfo_parse_line(const char *line, unsigned *maj, unsigned *min,
return 0;
}
devmapper += 12; /* skip fixed prefix */
for (i = 0; devmapper[i] && devmapper[i] != ' ' && i < sizeof(root); ++i)
for (i = 0; devmapper[i] && devmapper[i] != ' ' && i < sizeof(root)-1; ++i)
root[i] = devmapper[i];
root[i] = 0;
_unmangle_mountinfo_string(root, buf);