libparted: Fix potential NULL dereference in ped_disk
(cherry picked from commit a0a151d6fe80e8f34dfd73dca17eaed642372649)
This commit is contained in:
parent
f69ac4a243
commit
7d32153496
@ -0,0 +1,30 @@
|
||||
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 5aaac5a..405400e 100644
|
||||
--- a/libparted/disk.c
|
||||
+++ b/libparted/disk.c
|
||||
@@ -1552,8 +1552,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.33.0
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
Summary: The GNU disk partition manipulation program
|
||||
Name: parted
|
||||
Version: 3.3
|
||||
Release: 6
|
||||
Release: 7
|
||||
URL: https://www.gnu.org/software/parted/
|
||||
Source0: ftp://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz
|
||||
Source1: ftp://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz.sig
|
||||
@ -31,6 +31,7 @@ Patch9000: 9000-Add-extra-judgment-for-a-partition-created-success.patch
|
||||
Patch9001: 9001-bugfix-parted-fix-failure-of-mklabel-gpt_sync_mbr.patch
|
||||
Patch9002: 9002-Fix-end_input-usage-in-do_resizepart.patch
|
||||
Patch9003: 9003-parted-remove-patch-which-modifid-cyl-size.patch
|
||||
Patch9004: 9004-libparted-Fix-potential-NULL-dereference-in-ped_disk.patch
|
||||
|
||||
%description
|
||||
The GNU Parted program allows you to create, destroy, resize, move,
|
||||
@ -115,6 +116,9 @@ fi
|
||||
%{_libdir}/pkgconfig/libparted*.pc
|
||||
|
||||
%changelog
|
||||
* Fri Mar 29 2024 Deyuan Fan <fandeyuan@kylinos.cn> - 3.3-7
|
||||
- libparted: Fix potential NULL dereference in ped_disk_next_partition
|
||||
|
||||
* Tue May 18 2021 wuguanghao<wuguanghao3@huawei.com> - 3.3-6
|
||||
- remove patch which modifid cyl-size
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user