[parted-devel] [PATCH] parted: Fix crash with name command and no disklabel (#1226067)

Brian C. Lane bcl at redhat.com
Mon Jul 13 23:56:42 UTC 2015


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




More information about the parted-devel mailing list