31 lines
876 B
Diff
31 lines
876 B
Diff
|
From 31db44c74a96f8e2b495205d18525449e9b29543 Mon Sep 17 00:00:00 2001
|
||
|
From: "Brian C. Lane" <bcl@redhat.com>
|
||
|
Date: Wed, 15 Feb 2023 10:13:58 -0800
|
||
|
Subject: [PATCH 19/24] libparted: Fix potential NULL dereference in
|
||
|
ped_disk_next_partition
|
||
|
|
||
|
---
|
||
|
libparted/disk.c | 5 ++++-
|
||
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
||
|
|
||
|
diff --git a/libparted/disk.c b/libparted/disk.c
|
||
|
index e1a3489..6c82877 100644
|
||
|
--- a/libparted/disk.c
|
||
|
+++ b/libparted/disk.c
|
||
|
@@ -1718,8 +1718,11 @@ ped_disk_next_partition (const PedDisk* disk, const PedPartition* part)
|
||
|
return part->part_list ? part->part_list : part->next;
|
||
|
if (part->next)
|
||
|
return part->next;
|
||
|
- if (part->type & PED_PARTITION_LOGICAL)
|
||
|
+ if (part->type & PED_PARTITION_LOGICAL) {
|
||
|
+ if (!ped_disk_extended_partition (disk))
|
||
|
+ return NULL;
|
||
|
return ped_disk_extended_partition (disk)->next;
|
||
|
+ }
|
||
|
return NULL;
|
||
|
}
|
||
|
|
||
|
--
|
||
|
2.39.2
|
||
|
|