diff options
author | CoprDistGit <infra@openeuler.org> | 2024-08-06 02:22:06 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-08-06 02:22:06 +0000 |
commit | 4f2b83cd074dd4ca966271611c2c7426796ee08f (patch) | |
tree | 0c9836ea826f294860bacdef312a61abdcdae3bc /0008-part-Fix-segfault-when-adding-a-partition-too-big-fo.patch | |
parent | d4519e44a5f6efd56e0943973dc3975e737e7139 (diff) |
automatic import of libblockdevopeneuler24.03_LTS
Diffstat (limited to '0008-part-Fix-segfault-when-adding-a-partition-too-big-fo.patch')
-rw-r--r-- | 0008-part-Fix-segfault-when-adding-a-partition-too-big-fo.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/0008-part-Fix-segfault-when-adding-a-partition-too-big-fo.patch b/0008-part-Fix-segfault-when-adding-a-partition-too-big-fo.patch new file mode 100644 index 0000000..84b753d --- /dev/null +++ b/0008-part-Fix-segfault-when-adding-a-partition-too-big-fo.patch @@ -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 + |