summaryrefslogtreecommitdiff
path: root/sci-astronomy/sextractor/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sci-astronomy/sextractor/files
reinit the tree, so we can have metadata
Diffstat (limited to 'sci-astronomy/sextractor/files')
-rw-r--r--sci-astronomy/sextractor/files/sextractor-2.19.5-fix-format-errors.patch65
-rw-r--r--sci-astronomy/sextractor/files/sextractor-2.19.5-have-malloc.patch32
-rw-r--r--sci-astronomy/sextractor/files/sextractor-2.19.5-have-mmap.patch55
-rw-r--r--sci-astronomy/sextractor/files/sextractor-2.19.5-sigbus.patch26
4 files changed, 178 insertions, 0 deletions
diff --git a/sci-astronomy/sextractor/files/sextractor-2.19.5-fix-format-errors.patch b/sci-astronomy/sextractor/files/sextractor-2.19.5-fix-format-errors.patch
new file mode 100644
index 000000000000..c20ce31ee30e
--- /dev/null
+++ b/sci-astronomy/sextractor/files/sextractor-2.19.5-fix-format-errors.patch
@@ -0,0 +1,65 @@
+Author: Ole Streicher <debian@liska.ath.cx>
+Description: Fix format security errors
+--- a/src/catout.c
++++ b/src/catout.c
+@@ -999,7 +999,7 @@
+ break;
+
+ case ASCII_SKYCAT:
+- fprintf(ascfile, skycattail);
++ fprintf(ascfile, "%s", skycattail);
+ if (!prefs.pipe_flag)
+ fclose(ascfile);
+ break;
+--- a/src/xml.c
++++ b/src/xml.c
+@@ -696,7 +696,7 @@
+ name, ucd);
+ break;
+ case P_STRING:
+- sprintf(value, (char *)key[i].ptr);
++ sprintf(value, "%s", (char *)key[i].ptr);
+ fprintf(file, " <PARAM name=\"%s\" datatype=\"char\" arraysize=\"*\""
+ " ucd=\"%s\" value=\"%s\"/>\n",
+ name, ucd, *value? value: " ");
+@@ -705,13 +705,13 @@
+ n = *(key[i].nlistptr);
+ if (n)
+ {
+- sprintf(value, ((char **)key[i].ptr)[0]);
++ sprintf(value, "%s", ((char **)key[i].ptr)[0]);
+ fprintf(file, " <PARAM name=\"%s\" datatype=\"char\""
+ " arraysize=\"*\" ucd=\"%s\" value=\"%s",
+ name, ucd, *value? value: " ");
+ for (j=1; j<n; j++)
+ {
+- sprintf(value, ((char **)key[i].ptr)[j]);
++ sprintf(value, "%s", ((char **)key[i].ptr)[j]);
+ fprintf(file, ",%s", *value? value: " ");
+ }
+ fprintf(file, "\"/>\n");
+@@ -722,7 +722,7 @@
+ name, ucd);
+ break;
+ case P_KEY:
+- sprintf(value, key[i].keylist[*((int *)key[i].ptr)]);
++ sprintf(value, "%s", key[i].keylist[*((int *)key[i].ptr)]);
+ fprintf(file, " <PARAM name=\"%s\" datatype=\"char\" arraysize=\"*\""
+ " ucd=\"%s\" value=\"%s\"/>\n",
+ name, ucd, value);
+@@ -731,13 +731,13 @@
+ n = *(key[i].nlistptr);
+ if (n)
+ {
+- sprintf(value, key[i].keylist[((int *)key[i].ptr)[0]]);
++ sprintf(value, "%s", key[i].keylist[((int *)key[i].ptr)[0]]);
+ fprintf(file, " <PARAM name=\"%s\" datatype=\"char\""
+ " arraysize=\"*\" ucd=\"%s\" value=\"%s",
+ name, ucd, value);
+ for (j=1; j<n; j++)
+ {
+- sprintf(value, key[i].keylist[((int *)key[i].ptr)[j]]);
++ sprintf(value, "%s", key[i].keylist[((int *)key[i].ptr)[j]]);
+ fprintf(file, ",%s", value);
+ }
+ fprintf(file, "\"/>\n");
diff --git a/sci-astronomy/sextractor/files/sextractor-2.19.5-have-malloc.patch b/sci-astronomy/sextractor/files/sextractor-2.19.5-have-malloc.patch
new file mode 100644
index 000000000000..dd10d4a2c3cd
--- /dev/null
+++ b/sci-astronomy/sextractor/files/sextractor-2.19.5-have-malloc.patch
@@ -0,0 +1,32 @@
+Author: Justin Pryzby <justinpryzby@users.sf.net>
+Description: (guess) Define rpl_malloc if not there.
+--- a/src/misc.c
++++ b/src/misc.c
+@@ -34,6 +34,8 @@
+ #include <time.h>
+ #include <sys/time.h>
+
++#include <sys/types.h>
++
+ #include "define.h"
+ #include "globals.h"
+
+@@ -153,3 +155,18 @@
+ }
+
+
++#if !HAVE_MALLOC
++#undef malloc
++
++// Allocate an N-byte block of memory from the heap. If N is zero,
++// allocate a 1-byte block.
++void *rpl_malloc(size_t n)
++{
++ void *malloc();
++ if (0==n) {
++ n = 1;
++ }
++
++ return malloc(n);
++}
++#endif
diff --git a/sci-astronomy/sextractor/files/sextractor-2.19.5-have-mmap.patch b/sci-astronomy/sextractor/files/sextractor-2.19.5-have-mmap.patch
new file mode 100644
index 000000000000..1b6565089849
--- /dev/null
+++ b/sci-astronomy/sextractor/files/sextractor-2.19.5-have-mmap.patch
@@ -0,0 +1,55 @@
+Author: Justin Pryzby <justinpryzby@users.sf.net>
+Description: (guess) Use mmap only if it exists.
+--- a/src/fits/fitsbody.c
++++ b/src/fits/fitsbody.c
+@@ -64,9 +64,12 @@
+ ***/
+ PIXTYPE *alloc_body(tabstruct *tab, void (*func)(PIXTYPE *ptr, int npix))
+ {
++#ifdef HAVE_MMAP
+ FILE *file;
+ PIXTYPE *buffer;
+- size_t npix, size, sizeleft, spoonful;
++ size_t sizeleft, spoonful;
++#endif
++ size_t npix, size;
+
+ if (!body_ramflag)
+ {
+@@ -87,7 +90,9 @@
+ /* Decide if the data will go in physical memory or on swap-space */
+ npix = tab->tabsize/tab->bytepix;
+ size = npix*sizeof(PIXTYPE);
++#if !HAVE_MMAP
+ if (size < body_ramleft)
++#endif
+ {
+ /*-- There should be enough RAM left: try to do a malloc() */
+ if ((tab->bodybuf = malloc(size)))
+@@ -105,6 +110,7 @@
+ tab->bodybuf = NULL;
+ }
+
++#if HAVE_MMAP
+ if (size < body_vramleft)
+ {
+ /*-- Convert and copy the data to a swap file, and mmap() it */
+@@ -144,6 +150,7 @@
+ return NULL;
+ return (PIXTYPE *)tab->bodybuf;
+ }
++#endif
+
+ /* If no memory left at all: forget it! */
+ return NULL;
+@@ -270,8 +277,10 @@
+ size = (tab->tabsize/tab->bytepix)*sizeof(PIXTYPE);
+ if (tab->swapflag)
+ {
++#if HAVE_MMAP
+ if (munmap(tab->bodybuf, size))
+ warning("Can't unmap ", tab->cat->filename);
++#endif
+ tab->swapflag = 0;
+ tab->bodybuf = NULL;
+ body_vramleft += size;
diff --git a/sci-astronomy/sextractor/files/sextractor-2.19.5-sigbus.patch b/sci-astronomy/sextractor/files/sextractor-2.19.5-sigbus.patch
new file mode 100644
index 000000000000..2796f63884e3
--- /dev/null
+++ b/sci-astronomy/sextractor/files/sextractor-2.19.5-sigbus.patch
@@ -0,0 +1,26 @@
+Author: Justin Pryzby <justinpryzby@users.sf.net>
+Description: (guess) Handle the "sigbus" case only if it exists
+--- a/src/fits/fitscleanup.c
++++ b/src/fits/fitscleanup.c
+@@ -164,7 +164,9 @@
+ /* Catch CTRL-Cs */
+ signal(SIGINT, signal_function);
+ /* Catch bus errors */
++#ifdef SIGBUS // TODO: what if it is an enum?
+ signal(SIGBUS, signal_function);
++#endif
+ /* Catch segmentation faults */
+ signal(SIGSEGV, signal_function);
+ /* Catch floating exceptions */
+@@ -195,9 +197,11 @@
+ case SIGINT:
+ fprintf(stderr, "^C\n");
+ exit(-1);
++#ifdef SIGBUS
+ case SIGBUS:
+ fprintf(stderr, "bus error\n");
+ exit(-1);
++#endif
+ case SIGSEGV:
+ fprintf(stderr, "segmentation fault\n");
+ exit(-1);