[Parted-commits] GNU Parted Official Repository: Changes to 'master'

Jim Meyering meyering at alioth.debian.org
Sat Dec 12 17:31:27 UTC 2009


 parted.spec.in  |    2 +-
 parted/parted.c |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit db229537339468b5d596c2020705520d379c162c
Author: Jim Meyering <meyering at redhat.com>
Date:   Sat Dec 12 18:31:04 2009 +0100

    ui: mkpart: avoid double free
    
    * parted/parted.c (do_mkpart): This function frees "part_name"
    immediately after the final use, but also upon e.g., ped_disk_commit
    failure.  Set part_name to NULL after the first free, to make
    the second a no-op after the first.

diff --git a/parted/parted.c b/parted/parted.c
index dba376d..6919701 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -878,7 +878,8 @@ do_mkpart (PedDevice** dev)
         /* set minor attributes */
         if (part_name)
                 PED_ASSERT (ped_partition_set_name (part, part_name), return 0);
-        free (part_name);
+        free (part_name);  /* avoid double-free upon failure */
+        part_name = NULL;
         if (!ped_partition_set_system (part, fs_type))
                 goto error_destroy_disk;
         if (ped_partition_is_flag_available (part, PED_PARTITION_LBA))

commit b4ce21cec4868ee244907c999be0e680590cc379
Author: Jim Meyering <meyering at redhat.com>
Date:   Sat Dec 12 08:28:20 2009 +0100

    build: update spec: gperf is a new build-requirement
    
    * parted.spec.in (BuildRequires): Add gperf.
    Reported by Jeff Darcy.

diff --git a/parted.spec.in b/parted.spec.in
index 7e697fe..cd5a99a 100644
--- a/parted.spec.in
+++ b/parted.spec.in
@@ -19,7 +19,7 @@ Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 License:   GPL
 Group:     Applications/System
 
-BuildRequires: e2fsprogs-devel readline-devel ncurses-devel
+BuildRequires: e2fsprogs-devel readline-devel ncurses-devel gperf
 BuildRequires: automake libtool gettext-devel texinfo pkgconfig
 
 BuildRequires: device-mapper-devel, libselinux-devel libsepol-devel



More information about the Parted-commits mailing list