]> sourceware.org Git - lvm2.git/commitdiff
libdm: fix buffer overflow
authorMarian Csontos <mcsontos@redhat.com>
Thu, 21 Jun 2018 08:20:09 +0000 (10:20 +0200)
committerMarian Csontos <mcsontos@redhat.com>
Thu, 21 Jun 2018 08:22:24 +0000 (10:22 +0200)
libdm/libdm-common.c

index 094e6185483b748fb4d28cf3bad58dd31352d2a1..40b366b989500288d9e8fdb16ff2565e95383796 100644 (file)
@@ -1763,7 +1763,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.031431 seconds and 5 git commands to generate.