]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
disk/lvm: Use zalloc to ensure that segments are initialised to sane value.
authorVladimir Serbinenko <phcoder@gmail.com>
Sat, 14 Feb 2015 19:31:00 +0000 (20:31 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Sat, 14 Feb 2015 19:31:00 +0000 (20:31 +0100)
Reported by: EmanueL Czirai.

grub-core/disk/lvm.c

index 862a9664f2c87a00db47d50c751d0e7cf2ebcca2..1e7f197f0706d42863f8be7c677779ea7a56af83 100644 (file)
@@ -426,7 +426,7 @@ grub_lvm_detect (grub_disk_t disk,
 #endif
                  goto lvs_fail;
                }
-             lv->segments = grub_malloc (sizeof (*seg) * lv->segment_count);
+             lv->segments = grub_zalloc (sizeof (*seg) * lv->segment_count);
              seg = lv->segments;
 
              for (i = 0; i < lv->segment_count; i++)