diff --git a/0001-Fix-segfault-on-some-weird-data-structures.patch b/0001-Fix-segfault-on-some-weird-data-structures.patch deleted file mode 100644 index 516224e699da98f75d2c8501c93fe21503610f8a..0000000000000000000000000000000000000000 --- a/0001-Fix-segfault-on-some-weird-data-structures.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 81c8bbee46ad6ebacf72eae70ba5147f376205a4 Mon Sep 17 00:00:00 2001 -From: Rod Smith -Date: Mon, 14 Sep 2020 10:08:18 -0400 -Subject: [PATCH] Fix segfault on some weird data structures - ---- - NEWS | 6 ++++++ - gpt.cc | 13 ++++++++++++- - support.h | 2 +- - 3 files changed, 19 insertions(+), 2 deletions(-) - -diff --git a/NEWS b/NEWS -index 54c865e..bac3da3 100644 ---- a/NEWS -+++ b/NEWS -@@ -1,3 +1,9 @@ -+1.0.6 (?/??/2020): -+------------------ -+ -+- Fixed bug that could cause segfault if GPT header claimed partition -+ entries are oversized. -+ - 1.0.5 (2/17/2020): - ------------------ - -diff --git a/gpt.cc b/gpt.cc -index fe8e956..1b4e10f 100644 ---- a/gpt.cc -+++ b/gpt.cc -@@ -1041,6 +1041,14 @@ int GPTData::LoadHeader(struct GPTHeader *header, DiskIO & disk, uint64_t sector - } // if - *crcOk = CheckHeaderCRC(&tempHeader); - -+ if (tempHeader.sizeOfPartitionEntries != sizeof(GPTPart)) { -+ cerr << "Warning: Partition table header claims that the size of partition table\n"; -+ cerr << "entries is " << tempHeader.sizeOfPartitionEntries << " bytes, but this program "; -+ cerr << " supports only " << sizeof(GPTPart) << "-byte entries.\n"; -+ cerr << "Adjusting accordingly, but partition table may be garbage.\n"; -+ tempHeader.sizeOfPartitionEntries = sizeof(GPTPart); -+ } -+ - if (allOK && (numParts != tempHeader.numParts) && *crcOk) { - allOK = SetGPTSize(tempHeader.numParts, 0); - } -@@ -1058,7 +1066,10 @@ int GPTData::LoadPartitionTable(const struct GPTHeader & header, DiskIO & disk, - uint32_t sizeOfParts, newCRC; - int retval; - -- if (disk.OpenForRead()) { -+ if (header.sizeOfPartitionEntries != sizeof(GPTPart)) { -+ cerr << "Error! GPT header contains invalid partition entry size!\n"; -+ retval = 0; -+ } else if (disk.OpenForRead()) { - if (sector == 0) { - retval = disk.Seek(header.partitionEntriesLBA); - } else { -diff --git a/support.h b/support.h -index 9a79b95..978bfe1 100644 ---- a/support.h -+++ b/support.h -@@ -8,7 +8,7 @@ - #ifndef __GPTSUPPORT - #define __GPTSUPPORT - --#define GPTFDISK_VERSION "1.0.5" -+#define GPTFDISK_VERSION "1.0.5.1" - - #if defined (__FreeBSD__) || defined (__FreeBSD_kernel__) || defined (__APPLE__) - // Darwin (Mac OS) & FreeBSD: disk IOCTLs are different, and there is no lseek64 --- -1.8.3.1 - diff --git a/gdisk.spec b/gdisk.spec index 294645f7264c5472f25911543080fee1c219a0d3..2de5ed7ba45fb4bb3322717ccc4c100590551194 100644 --- a/gdisk.spec +++ b/gdisk.spec @@ -1,14 +1,11 @@ Name: gdisk -Version: 1.0.5 -Release: 6 +Version: 1.0.8 +Release: 1 Summary: GPT fdisk(consisting of the gdisk,sgdisk,cgdisk) is a set of text-mode partitioning tools License: GPLv2 URL: http://www.rodsbooks.com/gdisk Source0: http://downloads.sourceforge.net/gptfdisk/gptfdisk-%{version}.tar.gz -Patch1: 0001-Fix-segfault-on-some-weird-data-structures.patch - - BuildRequires:ncurses-devel util-linux-devel gcc-c++ popt-devel %description @@ -51,6 +48,9 @@ install -Dp -m 0644 fixparts.8 %{buildroot}%{_mandir}/man8/fixparts.8 %{_mandir}/man8/* %changelog +* Wed Nov 17 2021 Wenchao Hao - 1.0.8-1 +- update to gptfdisk-1.0.8 + * Fri Jul 30 2021 chenyanpanHW - 1.0.5-6 - DESC: delete -Sgit from %autosetup, and delete BuildRequires git diff --git a/gptfdisk-1.0.5.tar.gz b/gptfdisk-1.0.5.tar.gz deleted file mode 100644 index 15436d92cc5c339ca18d22846c1d0a399577a0c7..0000000000000000000000000000000000000000 Binary files a/gptfdisk-1.0.5.tar.gz and /dev/null differ diff --git a/gptfdisk-1.0.8.tar.gz b/gptfdisk-1.0.8.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..10795058fe54cca20eb04a8181d33118f1da3cbf Binary files /dev/null and b/gptfdisk-1.0.8.tar.gz differ