neil / rpms / udisks2

Forked from rpms/udisks2 a year ago
Clone

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

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