[parted-devel] [PATCH v2] dasd: avoid usage of uninitialized data
Petr Uzel
petr.uzel at suse.cz
Thu Mar 27 07:31:42 UTC 2014
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 a769866..c007427 100644
--- a/libparted/labels/dasd.c
+++ b/libparted/labels/dasd.c
@@ -658,7 +658,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.8.4.5
Petr
--
Petr Uzel
TL SUSE L3 Team 2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/parted-devel/attachments/20140327/8a612736/attachment.sig>
More information about the parted-devel
mailing list