parted/0100-dasd-avoid-usage-of-uninitialized-data.patch
Brian C. Lane 73aa139585 - Rebase on parted master commit 1da239e2ebd2
- libparted: Fix bug with dupe and empty name
2014-06-13 09:52:56 -07:00

32 lines
1001 B
Diff

From 97be947a7ed80dbd0ad29a56ab03c491904c2af8 Mon Sep 17 00:00:00 2001
From: Petr Uzel <petr.uzel@suse.cz>
Date: Thu, 27 Mar 2014 08:31:42 +0100
Subject: [PATCH 100/131] dasd: avoid usage of uninitialized data
In ped_partition_new(), disk_specific data of PedPartition
structure is allocated (via dasd_partition_new()). This
data is later used uninitialized in dasd_partition_set_system().
* libparted/labels/dasd.c (dasd_partition_new):
Zero out allocated disk_specific data.
---
libparted/labels/dasd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libparted/labels/dasd.c b/libparted/labels/dasd.c
index 081b3c5..c09b1d0 100644
--- a/libparted/labels/dasd.c
+++ b/libparted/labels/dasd.c
@@ -699,7 +699,7 @@ dasd_partition_new (const PedDisk* disk, PedPartitionType part_type,
if (!part)
goto error;
- part->disk_specific = ped_malloc (sizeof (DasdPartitionData));
+ part->disk_specific = ped_calloc (sizeof (DasdPartitionData));
return part;
error:
--
1.9.3