Blame SOURCES/pyparted-3.9-null-dereference.patch

4b950d
diff -up pyparted-3.9/src/pydisk.c.orig pyparted-3.9/src/pydisk.c
4b950d
--- pyparted-3.9/src/pydisk.c.orig	2018-01-12 13:47:27.488464829 -0500
4b950d
+++ pyparted-3.9/src/pydisk.c	2018-01-12 13:47:04.129550934 -0500
4b950d
@@ -209,7 +209,11 @@ int _ped_Partition_init(_ped_Partition *
4b950d
                 PyErr_SetString(PartitionException, partedExnMessage);
4b950d
             }
4b950d
         } else {
4b950d
-            PyErr_Format(PartitionException, "Could not create new partition on device %s", disk->dev->path);
4b950d
+            if (disk == NULL) {
4b950d
+               PyErr_Format(PartitionException, "Could not create new partition");
4b950d
+            } else {
4b950d
+                PyErr_Format(PartitionException, "Could not create new partition on device %s", disk->dev->path);
4b950d
+            }
4b950d
         }
4b950d
 
4b950d
         self->disk = self->fs_type = NULL;