neil / rpms / udisks2

Forked from rpms/udisks2 a year ago
Clone

Blame SOURCES/0001-udiskslinuxpartition-Fix-potential-NULL-dereference.patch

4efee1
From 9c87ed1f7a5daab0864b22be89ff58ffde51b5af Mon Sep 17 00:00:00 2001
4efee1
From: Tomas Bzatek <tbzatek@redhat.com>
4efee1
Date: Fri, 14 Jun 2019 17:11:16 +0200
4efee1
Subject: [PATCH] udiskslinuxpartition: Fix potential NULL dereference
4efee1
4efee1
---
4efee1
 src/udiskslinuxpartition.c | 2 +-
4efee1
 1 file changed, 1 insertion(+), 1 deletion(-)
4efee1
4efee1
diff --git a/src/udiskslinuxpartition.c b/src/udiskslinuxpartition.c
4efee1
index c29cf0fa..d00e6519 100644
4efee1
--- a/src/udiskslinuxpartition.c
4efee1
+++ b/src/udiskslinuxpartition.c
4efee1
@@ -198,7 +198,7 @@ static void update_partitions_list (UDisksObject           *disk_object,
4efee1
     /* this partition is already in the property */
4efee1
     goto out;
4efee1
 
4efee1
-  num_parts = g_strv_length (partitions);
4efee1
+  num_parts = partitions ? g_strv_length (partitions) : 0;
4efee1
   partitions = g_realloc (partitions, (num_parts + 2) * sizeof (gchar *));
4efee1
   partitions[num_parts] = g_strdup (object_path);
4efee1
   partitions[num_parts + 1] = NULL;
4efee1
-- 
4efee1
2.21.0
4efee1