iraf-community / iraf-fitsutil

FITS utilities
https://iraf.readthedocs.io/en/latest/tasks/fitsutil
Other
2 stars 1 forks source link

Update cfitsio to 3.450 #4

Closed olebole closed 6 years ago

olebole commented 6 years ago

This is basically an adoption of iraf/iraf-v216#135.

Version 3.450 is a security update of cfitsio that solves some vulnerabilities of the library, and its authors recommend to upgrade. This pull request does this. It also takes the chance to remove all cfitsio files that are not required to build the library. The shell script for this is adopted from astropy. Using the shell script also adds the following changes adding TPV, which were taken from the original IRAF code:

--- b/cfitsio/wcsutil.c
+++ a/cfitsio/wcsutil.c
@@ -81,8 +81,9 @@ int ffwldp(double xpix, double ypix, double xref, double yref,
       dect = dec0 + m;

     } else if (*cptr == 'T') {  /* -TAN */
-      if (*(cptr + 1) != 'A' ||  *(cptr + 2) != 'N') {
-         return(*status = 504);
+      if ( !(*(cptr + 1) == 'A' && *(cptr + 2) == 'N') && 
+           !(*(cptr + 1) == 'P' && *(cptr + 2) == 'V') ) {
+           return(*status = 504);
       }
       x = cos0*cos(ra0) - l*sin(ra0) - m*cos(ra0)*sin0;
       y = cos0*sin(ra0) + l*cos(ra0) - m*sin(ra0)*sin0;