From 0380a6b2b74281e555aa8c6be785c0ef1ca24a26 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Tue, 14 Jul 2015 14:52:14 -0700 Subject: [PATCH] - parted: Fix crash with name command and no disklabel (#1226067) --- ...-with-name-command-and-no-disklabel-.patch | 29 +++++++++++++++++++ parted.spec | 6 +++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 0014-parted-Fix-crash-with-name-command-and-no-disklabel-.patch diff --git a/0014-parted-Fix-crash-with-name-command-and-no-disklabel-.patch b/0014-parted-Fix-crash-with-name-command-and-no-disklabel-.patch new file mode 100644 index 0000000..7cb8c0b --- /dev/null +++ b/0014-parted-Fix-crash-with-name-command-and-no-disklabel-.patch @@ -0,0 +1,29 @@ +From f5c628dd51c7d77ff939554425159ab6e8aef1c0 Mon Sep 17 00:00:00 2001 +From: "Brian C. Lane" +Date: Mon, 13 Jul 2015 16:43:11 -0700 +Subject: [PATCH] parted: Fix crash with name command and no disklabel + (#1226067) + +A typo (the last I think) from commit 7eac058 wasn't properly checking +the result of ped_disk_new so it could crash if there was no disklabel +on the device. +--- + parted/parted.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/parted/parted.c b/parted/parted.c +index 2678554..a9426c4 100644 +--- a/parted/parted.c ++++ b/parted/parted.c +@@ -860,7 +860,7 @@ do_name (PedDevice** dev, PedDisk** diskp) + + if (!*diskp) + *diskp = ped_disk_new (*dev); +- if (!diskp) ++ if (!*diskp) + goto error; + + if (!command_line_get_partition (_("Partition number?"), *diskp, &part)) +-- +2.4.3 + diff --git a/parted.spec b/parted.spec index a784587..d33a4f7 100644 --- a/parted.spec +++ b/parted.spec @@ -4,7 +4,7 @@ Summary: The GNU disk partition manipulation program Name: parted Version: 3.2 -Release: 9%{?dist} +Release: 10%{?dist} License: GPLv3+ Group: Applications/System URL: http://www.gnu.org/software/parted @@ -27,6 +27,7 @@ Patch0010: 0010-libparted-device-mapper-uses-512b-sectors.patch Patch0011: 0011-Update-manpage-NAME-so-whatis-will-work.patch Patch0012: 0012-tests-Make-sure-the-extended-partition-length-is-2-1.patch Patch0013: 0013-libparted-BLKPG_RESIZE_PARTITION-uses-bytes-not-sect.patch +Patch0014: 0014-parted-Fix-crash-with-name-command-and-no-disklabel-.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: e2fsprogs-devel @@ -169,6 +170,9 @@ fi %changelog +* Mon Jul 13 2015 Brian C. Lane 3.2-10 +- parted: Fix crash with name command and no disklabel (#1226067) + * Thu Jun 18 2015 Fedora Release Engineering - 3.2-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild