Range check -i option (RHBZ#1007847).

This commit is contained in:
Richard W.M. Jones 2013-09-13 14:17:30 +01:00
parent 873f911a6e
commit 80396ba67a
2 changed files with 20 additions and 1 deletions

View File

@ -0,0 +1,13 @@
--- gptfdisk-0.8.7.old/gpt.cc 2013-07-09 03:01:09.000000000 +0100
+++ gptfdisk-0.8.7/gpt.cc 2013-09-13 14:12:19.154495469 +0100
@@ -1402,6 +1402,10 @@
// Show detailed information on the specified partition
void GPTData::ShowPartDetails(uint32_t partNum) {
+ if (partNum >= numParts) {
+ cerr << "Partition number out of range\n";
+ exit (1);
+ }
if (!IsFreePartNum(partNum)) {
partitions[partNum].ShowDetails(blockSize);
} else {

View File

@ -1,12 +1,14 @@
Summary: An fdisk-like partitioning tool for GPT disks Summary: An fdisk-like partitioning tool for GPT disks
Name: gdisk Name: gdisk
Version: 0.8.7 Version: 0.8.7
Release: 1%{?dist} Release: 2%{?dist}
License: GPLv2 License: GPLv2
URL: http://www.rodsbooks.com/gdisk/ URL: http://www.rodsbooks.com/gdisk/
Group: System Environment/Base Group: System Environment/Base
Source0: http://downloads.sourceforge.net/gptfdisk/gptfdisk-%{version}.tar.gz Source0: http://downloads.sourceforge.net/gptfdisk/gptfdisk-%{version}.tar.gz
Patch0: gptfdisk-0.8.1-gcc47.patch Patch0: gptfdisk-0.8.1-gcc47.patch
# RHBZ#1007847 - patch sent upstream on 2013-09-13.
Patch1: gdisk-0.8.7-add-range-check.patch
BuildRequires: popt-devel BuildRequires: popt-devel
BuildRequires: libicu-devel BuildRequires: libicu-devel
BuildRequires: libuuid-devel BuildRequires: libuuid-devel
@ -21,6 +23,7 @@ tables, and the ability to convert MBR disks to GPT format.
%prep %prep
%setup -q -n gptfdisk-%{version} %setup -q -n gptfdisk-%{version}
%patch0 -p1 %patch0 -p1
%patch1 -p1
chmod 0644 gdisk_test.sh chmod 0644 gdisk_test.sh
%build %build
@ -49,6 +52,9 @@ done
%{_mandir}/man8/fixparts.8* %{_mandir}/man8/fixparts.8*
%changelog %changelog
* Fri Sep 13 2013 Richard W.M. Jones <rjones@redhat.com> - 0.8.7-2
- Range check -i option (RHBZ#1007847).
* Sun Aug 11 2013 Terje Rosten <terje.rosten@ntnu.no> - 0.8.7-1 * Sun Aug 11 2013 Terje Rosten <terje.rosten@ntnu.no> - 0.8.7-1
- 0.8.7 - 0.8.7