about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2014-09-26 14:17:56 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2014-09-26 14:17:56 +0000
commitd93a83fb600112a3411a5a4931a2c1cb914e6079 (patch)
treeb2430ebab9c558c4d56dd7e69728569d243c5166
parent77eb12eb2edf32eb91a1e7ff11422500cca6c8ef (diff)
downloadnetpbm-mirror-d93a83fb600112a3411a5a4931a2c1cb914e6079.tar.gz
netpbm-mirror-d93a83fb600112a3411a5a4931a2c1cb914e6079.tar.xz
netpbm-mirror-d93a83fb600112a3411a5a4931a2c1cb914e6079.zip
Release 10.35.94
git-svn-id: http://svn.code.sf.net/p/netpbm/code/super_stable@2288 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--GNUmakefile2
-rw-r--r--Makefile.version2
-rw-r--r--converter/other/cameratopam/foveon.c2
-rw-r--r--doc/HISTORY22
-rw-r--r--lib/libpm.c16
-rw-r--r--lib/libsystem.c9
-rw-r--r--lib/ppm.h4
7 files changed, 39 insertions, 18 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 7a8725e9..06967e8d 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -135,7 +135,7 @@ pm_config.h: \
 	echo '#ifndef PM_CONFIG_H' >>$@ || $(DELETEIT)
 	echo '#define PM_CONFIG_H' >>$@ || $(DELETEIT)
 ifeq ($(INTTYPES_H)x,x)
-	echo '/* Don't need to #include any inttypes.h-type thing */
+	echo '/* Dont need to #include any inttypes.h-type thing */' >>$@
 else
   ifeq ($(INTTYPES_H),"inttypes_netpbm.h")
 	cat inttypes_netpbm.h >>$@ || $(DELETEIT)
diff --git a/Makefile.version b/Makefile.version
index cb92cf29..4ae14b07 100644
--- a/Makefile.version
+++ b/Makefile.version
@@ -1,3 +1,3 @@
 NETPBM_MAJOR_RELEASE = 10
 NETPBM_MINOR_RELEASE = 35
-NETPBM_POINT_RELEASE = 93
+NETPBM_POINT_RELEASE = 94
diff --git a/converter/other/cameratopam/foveon.c b/converter/other/cameratopam/foveon.c
index 0198940c..a8d62bee 100644
--- a/converter/other/cameratopam/foveon.c
+++ b/converter/other/cameratopam/foveon.c
@@ -482,7 +482,7 @@ foveon_interpolate(float coeff[3][4]) {
               foveon_avg (image[row*width]+c, dscr[1], cfilt) * 3
               - ddft[0][c][0] ) / 4 - ddft[0][c][1];
     }
-    memcpy (black, black+8, sizeof *black*8);
+    memcpy (black, black+8, sizeof (*black)*8);
     memcpy (black+height-11, black+height-22, 11*sizeof *black);
     memcpy (last, black, sizeof last);
 
diff --git a/doc/HISTORY b/doc/HISTORY
index e43611c9..ff36e4b8 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -4,6 +4,28 @@ Netpbm.
 CHANGE HISTORY 
 --------------
 
+14.09.26 BJH  Release 10.35.94
+
+              Fix incorrect option parsing when there are multiple common
+              options (e.g. -plain -quiet).  Always broken.  (Possibility of
+              specifying multiple common options that don't cause the program
+              to ignore every other option (like -version) was new in Netpbm
+              10.10 (October 2002).
+
+              libnetpbm whole-image functions: Fix undefined behavior due to
+              arithmetic overrun when size of image exceeds the capacity of
+              a signed integer.
+
+              cameratopam: fix buffer overflow.  Always present.  (cameratopam
+              was new in Netpbm 10.28 (June 2005)).
+
+              Build: fix build failure in an environment that does not have
+              __inline .  Introduced some time between Netpbm 10.26
+              (January 2005) and Netpbm 10.35 (August 2006).
+
+              Build: Fix failure to compile lib/libsystem.c because of
+              nonexistent signal classes on some systems.
+
 14.06.29 BJH  Release 10.35.93
 
               pamsharpness: put primary output on Standard Output instead of
diff --git a/lib/libpm.c b/lib/libpm.c
index 2e563a09..f00f5d16 100644
--- a/lib/libpm.c
+++ b/lib/libpm.c
@@ -213,7 +213,13 @@ pm_allocarray(int const cols, int const rows, int const size )  {
     if (rowIndex == NULL)
         pm_error("out of memory allocating row index (%u rows) for an array",
                  rows);
-    rowheap = malloc(rows * cols * size);
+
+    if (cols != 0 && rows != 0 && UINT_MAX / cols / rows < size)
+        /* Too big even to request the memory ! */
+        rowheap = NULL;
+    else
+        rowheap = malloc((unsigned int)rows * cols * size);
+
     if (rowheap == NULL) {
         /* We couldn't get the whole heap in one block, so try fragmented
            format.
@@ -576,7 +582,7 @@ pm_proginit(int * const argcP, char * argv[]) {
     show_version = FALSE;
     show_help = FALSE;
     pm_plain_output = FALSE;
-    for (argn = 1; argn < *argcP; ++argn) {
+    for (argn = i = 1; argn < *argcP; ++argn) {
         if (pm_keymatch(argv[argn], "-quiet", 6) ||
             pm_keymatch(argv[argn], "--quiet", 7)) 
             showmessages = FALSE;
@@ -591,11 +597,9 @@ pm_proginit(int * const argcP, char * argv[]) {
                  pm_keymatch(argv[argn], "--plain", 7))
             pm_plain_output = TRUE;
         else
-            continue;
-        for (i = argn + 1; i <= *argcP; ++i)
-            argv[i - 1] = argv[i];
-        --(*argcP);
+            argv[i++] = argv[argn];
     }
+    *argcP=i;
 
     pm_setMessage((unsigned int) showmessages, NULL);
 
diff --git a/lib/libsystem.c b/lib/libsystem.c
index 082ffdc0..b2f78ed4 100644
--- a/lib/libsystem.c
+++ b/lib/libsystem.c
@@ -201,8 +201,6 @@ signalName(unsigned int const signalClass) {
         return "SIGTTIN";
     case SIGTTOU: /* POSIX.1 */
         return "SIGTTOU";
-    case SIGURG:
-        return "SIGURG";
     case SIGXCPU:
         return "SIGXCPU";
     case SIGXFSZ:
@@ -211,10 +209,6 @@ signalName(unsigned int const signalClass) {
         return "SIGVTALRM";
     case SIGPROF:
         return "SIGPROF";
-    case SIGWINCH:
-        return "SIGWINCH";
-    case SIGIO:
-        return "SIGIO";
     case SIGSYS:
         return "SIGSYS";
     default:
@@ -223,7 +217,8 @@ signalName(unsigned int const signalClass) {
         /* There are various other signal classes on some systems, but
            not defined by POSIX and not on at least one system we
            know of for which someone wanted to compile Netpbm.  The
-           list includes: SIGPWR, SIGLOST, SIGINFO, SIGRTxx.
+           list includes: SIGPWR, SIGLOST, SIGINFO, SIGRTxx,
+           SIGURG, SIGWINCH, SIGIO.
         */
     }
 }
diff --git a/lib/ppm.h b/lib/ppm.h
index 033330b9..8471e767 100644
--- a/lib/ppm.h
+++ b/lib/ppm.h
@@ -233,7 +233,7 @@ struct hsv
 ppm_hsv_from_color(pixel  const color,
                    pixval const maxval);
 
-static __inline pixval
+static __inline__ pixval
 ppm_colorvalue(pixel const p) {
 /*----------------------------------------------------------------------------
   The color value (V is HSV) as a pixval
@@ -241,7 +241,7 @@ ppm_colorvalue(pixel const p) {
     return PPM_MAX(PPM_GETR(p), PPM_MAX(PPM_GETG(p), PPM_GETB(p)));
 }
 
-static __inline pixval
+static __inline__ pixval
 ppm_saturation(pixel const p,
                pixval const maxval) {
 /*----------------------------------------------------------------------------