From 7edab008dca7687d76026fb051cddf203a6ab08a Mon Sep 17 00:00:00 2001 From: Sebastien Fabbro Date: Sat, 31 Jan 2009 12:39:37 +0000 Subject: Added protection against null pointer dereferences, thanks to Paul Price, bug #256681 (Portage version: 2.2_rc23/cvs/Linux x86_64) --- sci-libs/cfitsio/ChangeLog | 12 ++++- sci-libs/cfitsio/cfitsio-3.090.ebuild | 58 --------------------- sci-libs/cfitsio/cfitsio-3.100-r1.ebuild | 59 ++++++++++++++++++++++ .../cfitsio/files/cfitsio-3.100-null-protect.patch | 39 ++++++++++++++ sci-libs/cfitsio/metadata.xml | 14 ++--- 5 files changed, 115 insertions(+), 67 deletions(-) delete mode 100644 sci-libs/cfitsio/cfitsio-3.090.ebuild create mode 100644 sci-libs/cfitsio/cfitsio-3.100-r1.ebuild create mode 100644 sci-libs/cfitsio/files/cfitsio-3.100-null-protect.patch (limited to 'sci-libs/cfitsio') diff --git a/sci-libs/cfitsio/ChangeLog b/sci-libs/cfitsio/ChangeLog index 613729136419..a892fc2aae9a 100644 --- a/sci-libs/cfitsio/ChangeLog +++ b/sci-libs/cfitsio/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for sci-libs/cfitsio -# Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sci-libs/cfitsio/ChangeLog,v 1.21 2008/08/22 18:26:16 bicatali Exp $ +# Copyright 2002-2009 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sci-libs/cfitsio/ChangeLog,v 1.22 2009/01/31 12:39:37 bicatali Exp $ + +*cfitsio-3.100-r1 (31 Jan 2009) + + 31 Jan 2009; Sébastien Fabbro + +files/cfitsio-3.100-null-protect.patch, metadata.xml, + -cfitsio-3.090.ebuild, +cfitsio-3.100-r1.ebuild: + Added protection against null pointer dereferences, thanks to Paul Price, + bug #256681 *cfitsio-3.100 (22 Aug 2008) diff --git a/sci-libs/cfitsio/cfitsio-3.090.ebuild b/sci-libs/cfitsio/cfitsio-3.090.ebuild deleted file mode 100644 index 83a3de67cc79..000000000000 --- a/sci-libs/cfitsio/cfitsio-3.090.ebuild +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sci-libs/cfitsio/cfitsio-3.090.ebuild,v 1.1 2008/06/18 21:47:57 bicatali Exp $ - -inherit eutils fortran autotools - -DESCRIPTION="C and Fortran library for manipulating FITS files" -HOMEPAGE="http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html" -SRC_URI="ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/${PN}${PV//.}.tar.gz" - -LICENSE="BSD GPL-2" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86" -IUSE="doc fortran" - -DEPEND="fortran? ( dev-lang/cfortran )" -RDEPEND="" - -S="${WORKDIR}/${PN}" - -pkg_setup() { - if use fortran; then - FORTRAN="gfortran g77 ifc" - fortran_pkg_setup - fi -} - -src_unpack() { - unpack ${A} - cd "${S}" - # avoid internal cfortran - if use fortran; then - sed -i \ - -e 's:"cfortran.h"::' \ - f77_wrap.h || die "sed fortran failed" - mv cfortran.h cfortran.h.disabled - fi - epatch "${FILESDIR}"/${P}-autotools.patch - eautoreconf -} - -src_compile() { - econf $(use_enable fortran) || die "econf failed" - emake || die "emake failed" -} - -src_install () { - emake DESTDIR="${D}" install || die "emake install failed" - dodoc changes.txt README cfitsio.doc || die "dodoc failed" - insinto /usr/share/doc/${PF}/examples - doins cookbook.c testprog.c speed.c smem.c || die "install examples failed" - use doc && dodoc cfitsio.ps quick.ps - if use fortran; then - doins cookbook.f || die "install cookbook failed" - dodoc fitsio.doc - use doc && dodoc fitsio.ps - fi -} diff --git a/sci-libs/cfitsio/cfitsio-3.100-r1.ebuild b/sci-libs/cfitsio/cfitsio-3.100-r1.ebuild new file mode 100644 index 000000000000..24ea7ea58707 --- /dev/null +++ b/sci-libs/cfitsio/cfitsio-3.100-r1.ebuild @@ -0,0 +1,59 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sci-libs/cfitsio/cfitsio-3.100-r1.ebuild,v 1.1 2009/01/31 12:39:37 bicatali Exp $ + +inherit eutils fortran autotools + +DESCRIPTION="C and Fortran library for manipulating FITS files" +HOMEPAGE="http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html" +SRC_URI="ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/${PN}${PV//.}.tar.gz" + +LICENSE="BSD GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86" +IUSE="doc fortran" + +DEPEND="fortran? ( dev-lang/cfortran )" +RDEPEND="" + +S="${WORKDIR}/${PN}" + +pkg_setup() { + if use fortran; then + FORTRAN="gfortran g77 ifc" + fortran_pkg_setup + fi +} + +src_unpack() { + unpack ${A} + epatch "${FILESDIR}"/${P}-null-protect.patch + cd "${S}" + # avoid internal cfortran + if use fortran; then + sed -i \ + -e 's:"cfortran.h"::' \ + f77_wrap.h || die "sed fortran failed" + mv cfortran.h cfortran.h.disabled + fi + epatch "${FILESDIR}"/${P}-autotools.patch + eautoreconf +} + +src_compile() { + econf $(use_enable fortran) || die "econf failed" + emake || die "emake failed" +} + +src_install () { + emake DESTDIR="${D}" install || die "emake install failed" + dodoc changes.txt README cfitsio.doc || die "dodoc failed" + insinto /usr/share/doc/${PF}/examples + doins cookbook.c testprog.c speed.c smem.c || die "install examples failed" + use doc && dodoc cfitsio.ps quick.ps + if use fortran; then + doins cookbook.f || die "install cookbook failed" + dodoc fitsio.doc + use doc && dodoc fitsio.ps + fi +} diff --git a/sci-libs/cfitsio/files/cfitsio-3.100-null-protect.patch b/sci-libs/cfitsio/files/cfitsio-3.100-null-protect.patch new file mode 100644 index 000000000000..5959b7fd3035 --- /dev/null +++ b/sci-libs/cfitsio/files/cfitsio-3.100-null-protect.patch @@ -0,0 +1,39 @@ +diff -Naur cfitsio.orig/edithdu.c cfitsio/edithdu.c +--- cfitsio.orig/edithdu.c 2009-01-31 12:30:07.196101165 +0000 ++++ cfitsio/edithdu.c 2009-01-31 12:32:03.467511681 +0000 +@@ -556,7 +556,9 @@ + return(*status); + + extnm[0] = '\0'; +- strncat(extnm, extnmx, FLEN_VALUE-1); ++ if (extnmx) { ++ strncat(extnm, extnmx, FLEN_VALUE-1); ++ } + + if (fptr->HDUposition != (fptr->Fptr)->curhdu) + ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status); +@@ -692,7 +694,9 @@ + return(*status); + + extnm[0] = '\0'; +- strncat(extnm, extnmx, FLEN_VALUE-1); ++ if (extnmx) { ++ strncat(extnm, extnmx, FLEN_VALUE-1); ++ } + + if (fptr->HDUposition != (fptr->Fptr)->curhdu) + ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status); +diff -Naur cfitsio.orig/putkey.c cfitsio/putkey.c +--- cfitsio.orig/putkey.c 2009-01-31 12:30:07.220108134 +0000 ++++ cfitsio/putkey.c 2009-01-31 12:32:49.566075447 +0000 +@@ -2729,7 +2729,9 @@ + } + + xtension[0] = '\0'; +- strncat(xtension, xtensionx, FLEN_VALUE-1); ++ if (xtensionx) { ++ strncat(xtension, xtensionx, FLEN_VALUE-1); ++ } + + ffpkys(fptr, "XTENSION", xtension, "extension type", status); + ffpkyj(fptr, "BITPIX", bitpix, "number of bits per data pixel", status); diff --git a/sci-libs/cfitsio/metadata.xml b/sci-libs/cfitsio/metadata.xml index cbd007c16aca..b455c7145fe3 100644 --- a/sci-libs/cfitsio/metadata.xml +++ b/sci-libs/cfitsio/metadata.xml @@ -4,12 +4,12 @@ sci nerdboy@gentoo.org -CFITSIO is a library of C and Fortran subroutines for reading and -writing data files in FITS (Flexible Image Transport System) data -format. CFITSIO provides simple high-level routines for reading and -writing FITS files that insulate the programmer from the internal -complexities of the FITS format. CFITSIO also provides advanced -features for manipulating and filtering the information in FITS -files. + CFITSIO is a library of C and Fortran subroutines for reading and + writing data files in FITS (Flexible Image Transport System) data + format. CFITSIO provides simple high-level routines for reading and + writing FITS files that insulate the programmer from the internal + complexities of the FITS format. CFITSIO also provides advanced + features for manipulating and filtering the information in FITS + files. -- cgit v1.2.3-65-gdbad