From: Vladimir Serbinenko Date: Sat, 14 Feb 2015 19:31:00 +0000 (+0100) Subject: disk/lvm: Use zalloc to ensure that segments are initialised to sane value. X-Git-Tag: 2.02-beta3~436 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ae9457e6eb4c352051fb32bc6fc931a22528ab2;p=thirdparty%2Fgrub.git disk/lvm: Use zalloc to ensure that segments are initialised to sane value. Reported by: EmanueL Czirai. --- diff --git a/grub-core/disk/lvm.c b/grub-core/disk/lvm.c index 862a9664f..1e7f197f0 100644 --- a/grub-core/disk/lvm.c +++ b/grub-core/disk/lvm.c @@ -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++)