Fix segfault when adding a partition too big for MSDOS
Resolves: rhbz#2207500
This commit is contained in:
parent
67f76c07af
commit
8d4508823b
@ -0,0 +1,32 @@
|
||||
From 9c96e621e9abb0649118d2e1731a09b1fa139579 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Wed, 19 Apr 2023 09:50:38 +0200
|
||||
Subject: [PATCH] part: Fix segfault when adding a partition too big for MSDOS
|
||||
|
||||
Resolves: rhbz#2185564
|
||||
---
|
||||
src/plugins/part.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/src/plugins/part.c b/src/plugins/part.c
|
||||
index 8b2285f5..28e20c28 100644
|
||||
--- a/src/plugins/part.c
|
||||
+++ b/src/plugins/part.c
|
||||
@@ -841,6 +841,14 @@ static gboolean resize_part (PedPartition *part, PedDevice *dev, PedDisk *disk,
|
||||
constr = ped_constraint_any (dev);
|
||||
|
||||
geom = ped_disk_get_max_partition_geometry (disk, part, constr);
|
||||
+ if (!geom) {
|
||||
+ set_parted_error (error, BD_PART_ERROR_FAIL);
|
||||
+ g_prefix_error (error, "Failed to create geometry for partition on device '%s'", dev->path);
|
||||
+ ped_constraint_destroy (constr);
|
||||
+ finish_alignment_constraint (disk, orig_flag_state);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
if (!ped_geometry_set_start (geom, start)) {
|
||||
set_parted_error (error, BD_PART_ERROR_FAIL);
|
||||
g_prefix_error (error, "Failed to set partition start on device '%s'", dev->path);
|
||||
--
|
||||
2.40.1
|
||||
|
@ -125,13 +125,14 @@
|
||||
|
||||
Name: libblockdev
|
||||
Version: 2.28
|
||||
Release: 3%{?dist}
|
||||
Release: 4%{?dist}
|
||||
Summary: A library for low-level manipulation with block devices
|
||||
License: LGPLv2+
|
||||
URL: https://github.com/storaged-project/libblockdev
|
||||
Source0: https://github.com/storaged-project/libblockdev/releases/download/%{version}-%{release}/%{name}-%{version}.tar.gz
|
||||
Patch0: 0001-crypto-Fix-GError-overwrite-from-libvolume_key.patch
|
||||
Patch1: 0002-tests-Fix-test_swapon_pagesize-on-systems-with-64k-p.patch
|
||||
Patch2: 0003-part-Fix-segfault-when-adding-a-partition-too-big-fo.patch
|
||||
|
||||
BuildRequires: make
|
||||
BuildRequires: glib2-devel
|
||||
@ -687,6 +688,7 @@ A meta-package that pulls all the libblockdev plugins as dependencies.
|
||||
%setup -q -n %{name}-%{version}
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
|
||||
%build
|
||||
autoreconf -ivf
|
||||
@ -990,6 +992,10 @@ find %{buildroot} -type f -name "*.la" | xargs %{__rm}
|
||||
%files plugins-all
|
||||
|
||||
%changelog
|
||||
* Tue May 16 2023 Vojtech Trefny <vtrefny@redhat.com> - 2.28-4
|
||||
- Fix segfault when adding a partition too big for MSDOS
|
||||
Resolves: rhbz#2207500
|
||||
|
||||
* Mon Apr 03 2023 Vojtech Trefny <vtrefny@redhat.com> - 2.28-3
|
||||
- Fix test_swapon_pagesize on systems with 64k pages
|
||||
Resolves: rhbz#2138698
|
||||
|
Loading…
Reference in New Issue
Block a user