grub2/0286-disk-lvm-Use-zalloc-to-ensure-that-segments-are-init.patch
Peter Jones 8c6b1ac71e Reconcile with upstream once again.
Also include some minor fixes for gcc 5.1.1

Signed-off-by: Peter Jones <pjones@redhat.com>
2015-07-22 09:46:32 -04:00

28 lines
830 B
Diff

From 2ae9457e6eb4c352051fb32bc6fc931a22528ab2 Mon Sep 17 00:00:00 2001
From: Vladimir Serbinenko <phcoder@gmail.com>
Date: Sat, 14 Feb 2015 20:31:00 +0100
Subject: [PATCH 286/506] disk/lvm: Use zalloc to ensure that segments are
initialised to sane value.
Reported by: EmanueL Czirai.
---
grub-core/disk/lvm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-core/disk/lvm.c b/grub-core/disk/lvm.c
index 862a966..1e7f197 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++)
--
2.4.3