From 97be947a7ed80dbd0ad29a56ab03c491904c2af8 Mon Sep 17 00:00:00 2001 From: Petr Uzel 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