about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2010-03-17 02:01:41 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2010-03-17 02:01:41 +0000
commit939ec42422e7db7c56ff5f736c00565f1bf621ff (patch)
treec4de7a33b8b637f926ec76efc0084efc7cb92bf1
parenteac71a920a648b88e97b851bac62dc861747a2ae (diff)
downloadnetpbm-mirror-939ec42422e7db7c56ff5f736c00565f1bf621ff.tar.gz
netpbm-mirror-939ec42422e7db7c56ff5f736c00565f1bf621ff.tar.xz
netpbm-mirror-939ec42422e7db7c56ff5f736c00565f1bf621ff.zip
Release 10.47.11
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@1150 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--converter/ppm/ppmtoilbm.c10
-rw-r--r--doc/HISTORY9
-rw-r--r--generator/pbmpage.c3
-rw-r--r--lib/libsystem.c6
4 files changed, 26 insertions, 2 deletions
diff --git a/converter/ppm/ppmtoilbm.c b/converter/ppm/ppmtoilbm.c
index 4a1b5cb7..5de167dc 100644
--- a/converter/ppm/ppmtoilbm.c
+++ b/converter/ppm/ppmtoilbm.c
@@ -37,6 +37,10 @@
 **  - added HAM colormap "rgb4" and "rgb5" (compute with 4/5-bit table)
 **  - added IFF text chunks
 **
+**  Feb 2010: afu
+**  Added dimension check to prevent short int from overflowing.
+**  
+**
 **  TODO:
 **  - multipalette capability (PCHG chunk) for std and HAM
 **
@@ -100,6 +104,8 @@
 #define DEF_DCOLPLANES  5
 #define DEF_IFMODE      MODE_DEEP
 
+#define INT16MAX 32767
+
 static void put_big_short ARGS((short s));
 static void put_big_long ARGS((long l));
 #define put_byte(b)     (void)(putc((unsigned char)(b), stdout))
@@ -1801,6 +1807,10 @@ init_read(fp, colsP, rowsP, maxvalP, formatP, readall)
     int readall;
 {
     ppm_readppminit(fp, colsP, rowsP, maxvalP, formatP);
+
+    if( *rowsP >INT16MAX || *colsP >INT16MAX )
+      pm_error ("Input image is too large.");
+
     if( readall ) {
         int row;
 
diff --git a/doc/HISTORY b/doc/HISTORY
index bc39f5ac..dde1f5b6 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -4,6 +4,15 @@ Netpbm.
 CHANGE HISTORY 
 --------------
 
+10.03.17 BJH  Release 10.47.11
+
+              ppmtoilbm: fix arithmetic overflow with image dimension
+              represented as 16 bit integer.
+
+              pbmpage: fix garbage output.
+
+              Build: don't fail due to SIGPWR being undefined.
+
 10.02.23 BJH  Release 10.47.10
 
               pnmhistmap: Fix crash with -width.  Always broken.
diff --git a/generator/pbmpage.c b/generator/pbmpage.c
index e10ee6d6..fcf7af42 100644
--- a/generator/pbmpage.c
+++ b/generator/pbmpage.c
@@ -246,6 +246,9 @@ main(int argc,char** argv) {
     bitmap.Pwidth = (Width + 7) / 8;
     bitmap.bitmap = malloc(bitmap.Pwidth * bitmap.Height);
 
+    for (x = 0; x < bitmap.Pwidth * bitmap.Height; ++x)
+        bitmap.bitmap[x] = 0x00;
+    
     if (argc>1)
         TP = atoi(argv[1]);
 
diff --git a/lib/libsystem.c b/lib/libsystem.c
index 8a0f520a..8e312fef 100644
--- a/lib/libsystem.c
+++ b/lib/libsystem.c
@@ -278,12 +278,14 @@ signalName(unsigned int const signalClass) {
             return "SIGWINCH";
         case SIGIO:
             return "SIGIO";
-        case SIGPWR:
-            return "SIGPWR";
         case SIGSYS:
             return "SIGSYS";
         default:
             return "???";
+
+            /* There are various other signal classes on some systems, but
+               not defined by POSIX, including: SIGPWR, SIGLOST, SIGINFO
+            */
         }
     } else if ((int)signalClass >= SIGRTMIN && (int)signalClass <= SIGRTMAX)
         return "SIGRTxxx";