From: Zdenek Kabelac Date: Mon, 15 Oct 2018 12:43:25 +0000 (+0200) Subject: cov: index off by one X-Git-Tag: v2_03_01~37 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=77aa055e8a34eb7f0036b6240f3f93dc429c0c02;p=lvm2.git cov: index off by one Basically apply stable patch fdb6ef8a85e9adc4805202b3200b17bd3b351982 to internal libdm version. --- diff --git a/device_mapper/libdm-common.c b/device_mapper/libdm-common.c index 111fff680..eec31d7fb 100644 --- a/device_mapper/libdm-common.c +++ b/device_mapper/libdm-common.c @@ -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);