Blame SOURCES/0008-parted-don-t-crash-in-disk_set-when-disk-label-not-f.patch

003ee8
From 624a8b14af7d358782ecc12627c84da72c28aeff Mon Sep 17 00:00:00 2001
003ee8
From: Phillip Susi <psusi@ubuntu.com>
003ee8
Date: Tue, 13 Jan 2015 11:05:48 -0500
003ee8
Subject: [PATCH 08/11] parted: don't crash in disk_set when disk label not
003ee8
 found
003ee8
003ee8
Due to a typeo in commit 7eac058 "parted: don't reload partition
003ee8
table on every command", the disk_set command would crash if
003ee8
a disk label was not found.
003ee8
---
003ee8
 NEWS            | 2 ++
003ee8
 parted/parted.c | 2 +-
003ee8
 2 files changed, 3 insertions(+), 1 deletion(-)
003ee8
003ee8
diff --git a/NEWS b/NEWS
003ee8
index da7db50..10c9a6e 100644
003ee8
--- a/NEWS
003ee8
+++ b/NEWS
003ee8
@@ -4,6 +4,8 @@ GNU parted NEWS                                    -*- outline -*-
003ee8
 
003ee8
 ** Bug Fixes
003ee8
 
003ee8
+  Don't crash in the disk_set command when a disk label is not found
003ee8
+
003ee8
   libparted-fs-resize: Prevent crash resizing FAT16 file systems.
003ee8
 
003ee8
 
003ee8
diff --git a/parted/parted.c b/parted/parted.c
003ee8
index f27a035..2678554 100644
003ee8
--- a/parted/parted.c
003ee8
+++ b/parted/parted.c
003ee8
@@ -1684,7 +1684,7 @@ do_disk_set (PedDevice** dev, PedDisk** diskp)
003ee8
 
003ee8
     if (!*diskp)
003ee8
             *diskp = ped_disk_new (*dev);
003ee8
-    if (!diskp)
003ee8
+    if (!*diskp)
003ee8
         goto error;
003ee8
 
003ee8
     if (!command_line_get_disk_flag (_("Flag to Invert?"), *diskp, &flag))
003ee8
-- 
003ee8
2.1.0
003ee8