summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKacper Kowalik <xarthisius@gentoo.org>2010-09-10 10:25:59 +0000
committerKacper Kowalik <xarthisius@gentoo.org>2010-09-10 10:25:59 +0000
commit1ff17a0a53c82177abf350363567b2e0812846d8 (patch)
tree1d31d7f6dd02d2b51624766a47586172fb929d13 /sci-astronomy/wcstools
parentVersion bump with support for the forthcoming Rails 3.0.x (diff)
downloadgentoo-2-1ff17a0a53c82177abf350363567b2e0812846d8.tar.gz
gentoo-2-1ff17a0a53c82177abf350363567b2e0812846d8.tar.bz2
gentoo-2-1ff17a0a53c82177abf350363567b2e0812846d8.zip
Fix multiple QA issues: implicit function declarations, invalid free, overflows, wrong printf format. Fixes bug 336601. Thanks to Diego for the report. Drop old.
(Portage version: 2.2_rc77/cvs/Linux x86_64)
Diffstat (limited to 'sci-astronomy/wcstools')
-rw-r--r--sci-astronomy/wcstools/ChangeLog15
-rw-r--r--sci-astronomy/wcstools/files/wcstools-3.7.0-fix-leaks.patch43
-rw-r--r--sci-astronomy/wcstools/files/wcstools-3.8.1-autotools.patch (renamed from sci-astronomy/wcstools/files/wcstools-3.7-autotools.patch)12
-rw-r--r--sci-astronomy/wcstools/files/wcstools-3.8.1-format.patch24
-rw-r--r--sci-astronomy/wcstools/files/wcstools-3.8.1-implicits.patch35
-rw-r--r--sci-astronomy/wcstools/files/wcstools-3.8.1-invalid_free.patch12
-rw-r--r--sci-astronomy/wcstools/files/wcstools-3.8.1-overflows.patch116
-rw-r--r--sci-astronomy/wcstools/wcstools-3.7.7.ebuild53
-rw-r--r--sci-astronomy/wcstools/wcstools-3.8.1-r1.ebuild (renamed from sci-astronomy/wcstools/wcstools-3.8.1.ebuild)23
9 files changed, 221 insertions, 112 deletions
diff --git a/sci-astronomy/wcstools/ChangeLog b/sci-astronomy/wcstools/ChangeLog
index 40061fa11ed4..06f4604b5d91 100644
--- a/sci-astronomy/wcstools/ChangeLog
+++ b/sci-astronomy/wcstools/ChangeLog
@@ -1,6 +1,19 @@
# ChangeLog for sci-astronomy/wcstools
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sci-astronomy/wcstools/ChangeLog,v 1.17 2010/01/29 06:51:38 bicatali Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-astronomy/wcstools/ChangeLog,v 1.18 2010/09/10 10:25:59 xarthisius Exp $
+
+*wcstools-3.8.1-r1 (10 Sep 2010)
+
+ 10 Sep 2010; Kacper Kowalik <xarthisius@gentoo.org>
+ -files/wcstools-3.7.0-fix-leaks.patch, -wcstools-3.7.7.ebuild,
+ -files/wcstools-3.7-autotools.patch, -wcstools-3.8.1.ebuild,
+ +wcstools-3.8.1-r1.ebuild, +files/wcstools-3.8.1-autotools.patch,
+ +files/wcstools-3.8.1-format.patch, +files/wcstools-3.8.1-implicits.patch,
+ +files/wcstools-3.8.1-invalid_free.patch,
+ +files/wcstools-3.8.1-overflows.patch:
+ Fix multiple QA issues: implicit function declarations, invalid free,
+ overflows, wrong printf format. Fixes bug 336601. Thanks to Diego for the
+ report. Drop old.
*wcstools-3.8.1 (29 Jan 2010)
diff --git a/sci-astronomy/wcstools/files/wcstools-3.7.0-fix-leaks.patch b/sci-astronomy/wcstools/files/wcstools-3.7.0-fix-leaks.patch
deleted file mode 100644
index 737f6d230dae..000000000000
--- a/sci-astronomy/wcstools/files/wcstools-3.7.0-fix-leaks.patch
+++ /dev/null
@@ -1,43 +0,0 @@
---- libwcs/imhfile.c.orig 2007-09-11 11:01:02.247828794 +0100
-+++ libwcs/imhfile.c 2007-09-11 11:00:39.330522811 +0100
-@@ -1036,11 +1036,11 @@
- int len;
- char *newpixname;
-
-- newpixname = (char *) calloc (SZ_IM2PIXFILE, 1);
-+ newpixname = (char *) calloc (SZ_IM2PIXFILE + 1, sizeof(char));
-
- /* Pixel file is in same directory as header */
- if (strncmp(pixname, "HDR$", 4) == 0 ) {
-- (void)strncpy (newpixname, hdrname, SZ_IM2PIXFILE);
-+ strncpy (newpixname, hdrname, SZ_IM2PIXFILE);
-
- /* find the end of the pathname */
- len = strlen (newpixname);
-@@ -1053,7 +1053,7 @@
-
- /* add name */
- newpixname[len] = '\0';
-- (void)strncat (newpixname, &pixname[4], SZ_IM2PIXFILE);
-+ strncat (newpixname, &pixname[4], SZ_IM2PIXFILE);
- }
-
- /* Bare pixel file with no path is assumed to be same as HDR$filename */
---- libwcs/imsetwcs.c.orig 2007-09-11 11:04:54.757078741 +0100
-+++ libwcs/imsetwcs.c 2007-09-11 11:04:31.563757029 +0100
-@@ -854,13 +854,13 @@
- if (gc) free ((char *)gc);
-
- /* Free memory used for object names in reference catalog */
-- if (gobj1 != NULL) {
-+ /* if (gobj1 != NULL) {
- for (i = 0; i < ns; i++) {
- if (gobj[i] != NULL) free (gobj[i]);
- gobj[i] = NULL;
- }
- }
--
-+ */
- /* Free image source arrays */
- if (sx) free ((char *)sx);
- if (sy) free ((char *)sy);
diff --git a/sci-astronomy/wcstools/files/wcstools-3.7-autotools.patch b/sci-astronomy/wcstools/files/wcstools-3.8.1-autotools.patch
index 761dff4ed232..f41d00add07c 100644
--- a/sci-astronomy/wcstools/files/wcstools-3.7-autotools.patch
+++ b/sci-astronomy/wcstools/files/wcstools-3.8.1-autotools.patch
@@ -2,7 +2,7 @@
+++ configure.ac 2008-11-03 09:59:35.000000000 +0000
@@ -0,0 +1,11 @@
+AC_PREREQ([2.59])
-+AC_INIT(wcstools, 3.7.x, [http://tdc-www.harvard.edu/wcstools/])
++AC_INIT(wcstools, 3.8.1 , [http://tdc-www.harvard.edu/wcstools/])
+AM_INIT_AUTOMAKE([foreign])
+AM_CONFIG_HEADER(config.h)
+
@@ -57,12 +57,12 @@
+ cphead delwcs delhead edhead fixpix gethead i2f imcat imhead immatch \
+ imrot imsize imstar imwcs scat sethead addpix getpix setpix sky2xy \
+ keyhead skycoor subpix xy2sky wcshead conpix gettab newfits getfits \
-+ imstack imextract sumpix remap getcol getdate imfill imsmooth imresize \
-+ fileroot filename filext char2sp sp2char crlf isnum isrange isfits \
++ imstack imextract sumpix wcsremap getcol wcsgetdate imfill imsmooth imresize \
++ fileroot filename filext char2sp sp2char wcscrlf isnum isrange isfits \
+ simpos nedpos bincat nedname
+
+# these ones don't need libwcs
-+crlf_SOURCES = crlf.c
++wcscrlf_SOURCES = crlf.c
+filename_SOURCES = filename.c
+fileroot_SOURCES = fileroot.c
+filext_SOURCES = filext.c
@@ -72,7 +72,7 @@
+
+bincat_SOURCES = bincat.c
+getcol_SOURCES = getcol.c
-+getdate_SOURCES = getdate.c
++wcsgetdate_SOURCES = getdate.c
+gethead_SOURCES = gethead.c
+getfits_SOURCES = getfits.c
+getpix_SOURCES = getpix.c
@@ -108,7 +108,7 @@
+isnum_SOURCES = isnum.c
+keyhead_SOURCES = keyhead.c
+newfits_SOURCES = newfits.c
-+remap_SOURCES = remap.c
++wcsremap_SOURCES = remap.c
+sethead_SOURCES = sethead.c
+sky2xy_SOURCES = sky2xy.c
+sp2char_SOURCES = sp2char.c
diff --git a/sci-astronomy/wcstools/files/wcstools-3.8.1-format.patch b/sci-astronomy/wcstools/files/wcstools-3.8.1-format.patch
new file mode 100644
index 000000000000..32bc9c350dc6
--- /dev/null
+++ b/sci-astronomy/wcstools/files/wcstools-3.8.1-format.patch
@@ -0,0 +1,24 @@
+warning: too few arguments for format
+
+--- libwcs/ucacread.c
++++ libwcs/ucacread.c
+@@ -734,7 +734,7 @@
+ else if (ucat == UCAC2) {
+ fprintf (stderr,"UCACRNUM: %11.6f: %9.5f %9.5f %5.2f",
+ num, ra, dec, star->xmag[0]);
+- fprintf (stderr," %5.2f %5.2f %5.2f %d %d",
++ fprintf (stderr," %5.2f %5.2f %5.2f",
+ star->xmag[1],star->xmag[2],star->xmag[3]);
+ fprintf (stderr," %d %d\n",star->nimage,star->ncat);
+ }
+--- imcat.c
++++ imcat.c
+@@ -1923,7 +1923,7 @@
+ if (tabout && (refcat == UCAC2 || refcat == UCAC3)) {
+ era = gm[nmag][i] * cosdeg (gdec[i]) * 3600.0;
+ edec = gm[nmag+1][i] * 3600.0;
+- sprintf (temp, " %5.3f %5.3f");
++ sprintf (temp, " %5.3f %5.3f", era, edec);
+ strcat (headline, temp);
+ }
+ for (imag = 0; imag < nmag; imag++) {
diff --git a/sci-astronomy/wcstools/files/wcstools-3.8.1-implicits.patch b/sci-astronomy/wcstools/files/wcstools-3.8.1-implicits.patch
new file mode 100644
index 000000000000..df857e7bce37
--- /dev/null
+++ b/sci-astronomy/wcstools/files/wcstools-3.8.1-implicits.patch
@@ -0,0 +1,35 @@
+* ned_sk.c:152:4: warning: implicit declaration of function ‘inet_addr’
+* isfits.c:54:2: warning: implicit declaration of function ‘isfits’
+* nedpos.c:130:6: warning: implicit declaration of function ‘isfile’
+* nedpos.c:131:3: warning: implicit declaration of function ‘getfilelines’
+
+--- wcstools-3.8.1/libned/ned_sk.c
++++ wcstools-3.8.1/libned/ned_sk.c
+@@ -57,6 +57,7 @@
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
++#include <arpa/inet.h>
+ #include <netdb.h>
+
+ #include <sys/resource.h>
+--- wcstools-3.8.1/nedpos.c
++++ wcstools-3.8.1/nedpos.c
+@@ -8,6 +8,7 @@
+ #include <string.h>
+ #include "libned/ned_client.h"
+ #include "libwcs/wcs.h"
++#include "libwcs/fitsfile.h"
+
+ static char *RevMsg = "NEDPOS 3.8.1, 14 December 2009, Doug Mink SAO";
+
+--- wcstools-3.8.1/isfits.c
++++ wcstools-3.8.1/isfits.c
+@@ -27,6 +27,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include "libwcs/fitshead.h"
++#include "libwcs/fitsfile.h"
+
+ static char *RevMsg = "ISFITS WCSTools 3.8.1, 14 December 2009, Doug Mink (dmink@cfa.harvard.edu)";
+
diff --git a/sci-astronomy/wcstools/files/wcstools-3.8.1-invalid_free.patch b/sci-astronomy/wcstools/files/wcstools-3.8.1-invalid_free.patch
new file mode 100644
index 000000000000..40a5649997a7
--- /dev/null
+++ b/sci-astronomy/wcstools/files/wcstools-3.8.1-invalid_free.patch
@@ -0,0 +1,12 @@
+* imhfile.c:1022:10: warning: attempt to free a non-heap object ‘pixname’
+
+--- wcstools-3.8.1/libwcs/imhfile.c
++++ wcstools-3.8.1/libwcs/imhfile.c
+@@ -1019,7 +1019,6 @@
+ nbw = write (fd, image, nbimage);
+ close (fd);
+
+- free (pixname);
+ return (nbw);
+ }
+
diff --git a/sci-astronomy/wcstools/files/wcstools-3.8.1-overflows.patch b/sci-astronomy/wcstools/files/wcstools-3.8.1-overflows.patch
new file mode 100644
index 000000000000..863fb6731d68
--- /dev/null
+++ b/sci-astronomy/wcstools/files/wcstools-3.8.1-overflows.patch
@@ -0,0 +1,116 @@
+ call to {} will always overflow destination buffer
+* In function ‘strcpy’, inlined from ‘CopyValues’ at cphead.c:579:9
+* In function ‘strcpy’, inlined from ‘CopyValues’ at cphead.c:602:14
+* In function ‘strcpy’, inlined from ‘SetValues’ at sethead.c:1134:9
+* In function ‘strcpy’, inlined from ‘SetValues’ at sethead.c:1177:14
+* In function ‘strcpy’, inlined from ‘ChangeKeyNames’ at keyhead.c:469:9
+* In function ‘strcpy’, inlined from ‘ChangeKeyNames’ at keyhead.c:487:14
+* In function ‘strcpy’, inlined from ‘ConvertDate’ at getdate.c:452:12
+
+--- wcstools-3.8.1/cphead.c
++++ wcstools-3.8.1/cphead.c
+@@ -372,7 +372,7 @@
+ char *ltime;
+ int naxis, ipos, nbhead, nbr, nbw;
+ int fdr, fdw;
+- char history[72];
++ char history[75];
+ char echar;
+ char *endchar;
+ int imageread = 0;
+@@ -574,7 +574,7 @@
+
+ /* Add history to header */
+ if (keyset || histset) {
+- if (hgets (headout, "CPHEAD", 72, history))
++ if (hgets (headout, "CPHEAD", 75, history))
+ hputc (headout, "HISTORY", history);
+ strcpy (history, RevMsg);
+ endchar = strchr (history, ',');
+@@ -593,7 +593,7 @@
+ lkwd = strlen (kwd[ikwd]);
+
+ /* If too may keywords, start a second history line */
+- if (lhist + lkwd + 10 > 71) {
++ if (lhist + lkwd + 10 > 74) {
+ if (histset) {
+ if (history[lhist-2] == ',')
+ history[lhist-2] = (char) 0;
+--- wcstools-3.8.1/sethead.c
++++ wcstools-3.8.1/sethead.c
+@@ -616,7 +616,7 @@
+ int nbold, nbnew;
+ int imageread = 0;
+ char cval[24];
+- char history[72];
++ char history[76];
+ char *endchar;
+ char *ltime;
+ char newkey[10];
+@@ -891,7 +891,7 @@
+
+ /* Add, subtract, multiply, or divide keyword value by constant */
+ if (keyop) {
+- if (!hgets (header, opkey, 72,string)) {
++ if (!hgets (header, opkey, 76,string)) {
+ if (verbose)
+ printf ("* %s %c %s keyword not in header.\n",
+ opkey, ops[keyop], kwv);
+@@ -1129,7 +1129,7 @@
+
+ /* Add history to header */
+ if (keyset || histset) {
+- if (hgets (header, "SETHEAD", 72, history))
++ if (hgets (header, "SETHEAD", 76, history))
+ hputc (header, "HISTORY", history);
+ strcpy (history, RevMsg);
+ endchar = strchr (history, ',');
+@@ -1170,7 +1170,7 @@
+ lkwd = strlen (kwd[ikwd]);
+
+ /* If too may keywords, start a second history line */
+- if (lhist + lkwd + 10 > 71) {
++ if (lhist + lkwd + 10 > 75) {
+ if (histset) {
+ strcat (history, " updated");
+ hputc (header, "HISTORY", history);
+--- wcstools-3.8.1/keyhead.c
++++ wcstools-3.8.1/keyhead.c
+@@ -283,7 +283,7 @@
+ int imageread = 0;
+ char cval[24];
+ int fdr, fdw, ipos, nbr, nbw, nchange;
+- char history[72];
++ char history[76];
+ char comment[72];
+ char *endchar;
+ char *ltime;
+@@ -464,7 +464,7 @@
+
+ /* Add history to header */
+ if (keyset || histset) {
+- if (hgets (header, "KEYHEAD", 72, history))
++ if (hgets (header, "KEYHEAD", 76, history))
+ hputc (header, "HISTORY", history);
+ strcpy (history, RevMsg);
+ endchar = strchr (history, ',');
+@@ -480,7 +480,7 @@
+ lkwd = strlen (kwd[ikwd]);
+
+ /* If too may keywords, start a second history line */
+- if (lhist + lkwd > 71) {
++ if (lhist + lkwd > 75) {
+ if (histset) {
+ strcat (history, " updated");
+ hputc (header, "HISTORY", history);
+--- wcstools-3.8.1/getdate.c
++++ wcstools-3.8.1/getdate.c
+@@ -444,7 +444,7 @@
+ char *fitsdate, *newfdate, *stdate;
+ char temp[64];
+ char fyear[16];
+- char ts0[8];
++ char ts0[9];
+ char *tchar;
+ int its, its1;
+ time_t lts;
diff --git a/sci-astronomy/wcstools/wcstools-3.7.7.ebuild b/sci-astronomy/wcstools/wcstools-3.7.7.ebuild
deleted file mode 100644
index b9ab73e43073..000000000000
--- a/sci-astronomy/wcstools/wcstools-3.7.7.ebuild
+++ /dev/null
@@ -1,53 +0,0 @@
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sci-astronomy/wcstools/wcstools-3.7.7.ebuild,v 1.3 2009/09/09 16:06:30 bicatali Exp $
-
-EAPI=2
-inherit eutils autotools
-
-DESCRIPTION="World Coordinate System library for astronomical FITS images"
-HOMEPAGE="http://tdc-www.harvard.edu/software/wcstools"
-SRC_URI="http://tdc-www.harvard.edu/software/${PN}/${P}.tar.gz"
-
-LICENSE="GPL-2 LGPL-2.1"
-SLOT="0"
-KEYWORDS="~amd64 ~ppc ~x86"
-IUSE=""
-
-src_prepare() {
- epatch "${FILESDIR}"/${PN}-3.7.0-fix-leaks.patch
- epatch "${FILESDIR}"/${PN}-3.7-autotools.patch
- # avoid colliding with fixdos, getdate and remap from other packages
- sed -i \
- -e 's/getdate/wcsgetdate/' \
- -e 's/crlf/wcscrlf/' \
- -e 's/remap/wcsremap/' \
- wcstools Makefile.am || die
- sed -i -e "s/3.7.x/${PV}/" "${S}"/configure.ac || die "sed failed"
- eautoreconf
-}
-
-src_test() {
- einfo "Testing various wcstools programs"
- ./newfits -a 10 -j 248 41 -p 0.15 test.fits || die "test newfits failed"
- ./sethead test.fits A=1 B=1 || die "test sethead failed"
- [[ "$(./gethead test.fits RA)" == "16:32:00.000" ]] \
- || die "test gethead failed"
- rm -f test.fits
-}
-
-src_install() {
- emake DESTDIR="${D}" install || die "emake install failed"
- doman Man/man1/* || die "doman failed"
- dodoc Readme Programs NEWS libned/NED_client || die "dodoc failed"
- newdoc libwcs/Readme Readme.libwcs || die "newdoc failed"
- newdoc libwcs/NEWS NEWS.libwcs || die "newdoc failed"
-}
-
-pkg_postinst() {
- elog "The following execs have been renamed to avoid colliding"
- elog "with other packages:"
- elog " getdate -> wcsgetdate"
- elog " crlf -> wcscrlf"
- elog " remap -> wcsremap"
-}
diff --git a/sci-astronomy/wcstools/wcstools-3.8.1.ebuild b/sci-astronomy/wcstools/wcstools-3.8.1-r1.ebuild
index fe1698bf5877..d8701007de35 100644
--- a/sci-astronomy/wcstools/wcstools-3.8.1.ebuild
+++ b/sci-astronomy/wcstools/wcstools-3.8.1-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sci-astronomy/wcstools/wcstools-3.8.1.ebuild,v 1.1 2010/01/29 06:51:38 bicatali Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-astronomy/wcstools/wcstools-3.8.1-r1.ebuild,v 1.1 2010/09/10 10:25:59 xarthisius Exp $
EAPI=2
inherit eutils autotools
@@ -15,14 +15,19 @@ KEYWORDS="~amd64 ~ppc ~x86"
IUSE=""
src_prepare() {
- epatch "${FILESDIR}"/${PN}-3.7-autotools.patch
+ epatch "${FILESDIR}"/${P}-autotools.patch \
+ "${FILESDIR}"/${P}-format.patch \
+ "${FILESDIR}"/${P}-implicits.patch \
+ "${FILESDIR}"/${P}-invalid_free.patch \
+ "${FILESDIR}"/${P}-overflows.patch
+
# avoid colliding with fixdos, getdate and remap from other packages
sed -i \
-e 's/getdate/wcsgetdate/' \
-e 's/crlf/wcscrlf/' \
-e 's/remap/wcsremap/' \
- wcstools Makefile.am || die
- sed -i -e "s/3.7.x/${PV}/" "${S}"/configure.ac || die "sed failed"
+ -e "s/3.7.x/${PV}/" \
+ wcstools || die
eautoreconf
}
@@ -36,11 +41,11 @@ src_test() {
}
src_install() {
- emake DESTDIR="${D}" install || die "emake install failed"
- doman Man/man1/* || die "doman failed"
- dodoc Readme Programs NEWS libned/NED_client || die "dodoc failed"
- newdoc libwcs/Readme Readme.libwcs || die "newdoc failed"
- newdoc libwcs/NEWS NEWS.libwcs || die "newdoc failed"
+ emake DESTDIR="${D}" install || die
+ doman Man/man1/* || die
+ dodoc Readme Programs NEWS libned/NED_client || die
+ newdoc libwcs/Readme Readme.libwcs || die
+ newdoc libwcs/NEWS NEWS.libwcs || die
}
pkg_postinst() {