set_protective_mbr: allocate target size, not ptr
the code was allocating only a 4-byte buffer (sizeof the pointer),
but was accessing into an expected 512-byte buffer.
BUG: 30147678
Change-Id: I1e2fe5d72f8c5398478a5549d43df6ef86faf4c9
diff --git a/disk/part_efi.c b/disk/part_efi.c
index 59cd538..b555ff3 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -237,7 +237,7 @@
legacy_mbr *p_mbr;
/* Setup the Protective MBR */
- p_mbr = calloc(1, sizeof(p_mbr));
+ p_mbr = (legacy_mbr *)calloc(1, sizeof(legacy_mbr));
if (p_mbr == NULL) {
printf("%s: calloc failed!\n", __func__);
return -1;