]> sourceware.org Git - lvm2.git/commitdiff
cov: index off by one
authorZdenek Kabelac <zkabelac@redhat.com>
Mon, 15 Oct 2018 12:43:25 +0000 (14:43 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Mon, 15 Oct 2018 15:49:44 +0000 (17:49 +0200)
Basically apply stable patch fdb6ef8a85e9adc4805202b3200b17bd3b351982 to internal libdm version.

device_mapper/libdm-common.c

index 111fff68046d40dc05ffdb608f4a96d827caf332..eec31d7fb0d0d0177e6ad9a5a098fb2d22b70b23 100644 (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);
This page took 0.040193 seconds and 5 git commands to generate.