On Fri, Mar 21, 2014 at 04:40:34PM -0700, Brian C. Lane wrote: > On Thu, Mar 20, 2014 at 04:33:42PM +0100, Petr Uzel wrote: > > 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/vtoc.c (dasd_partition_new): > > Zero out allocated disk_specific data. > > --- > > libparted/labels/dasd.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/libparted/labels/dasd.c b/libparted/labels/dasd.c > > index a769866..f5b0f2b 100644 > > --- a/libparted/labels/dasd.c > > +++ b/libparted/labels/dasd.c > > @@ -659,6 +659,8 @@ dasd_partition_new (const PedDisk* disk, > > PedPartitionType part_type, > > goto error; > > > > part->disk_specific = ped_malloc (sizeof (DasdPartitionData)); > > + if (part->disk_specific) > > + memset(part->disk_specific, 0, sizeof(DasdPartitionData)); > > return part; > > Good idea, but you should just use ped_calloc instead.
Heh, of course - I have no idea why I did not use it right away :/
Updated version sent to mailing list.
Thanks,
Petr
--
Petr Uzel
TL SUSE L3 Team 2
signature.asc
Description: Digital signature

