From d776db307953dade8f1f8c289998802ccc113f1b Mon Sep 17 00:00:00 2001 From: Petr Hracek Date: Tue, 11 Aug 2015 10:11:35 +0200 Subject: [PATCH] New upstream release 10.71.02 (#1252352) Signed-off-by: Petr Hracek --- .gitignore | 1 + netpbm-CAN-2005-2471.patch | 9 +- netpbm-bmptopnm.patch | 8 +- netpbm-cmuwtopbm.patch | 9 +- netpbm-config.patch | 20 + netpbm-disable-pbmtog3.patch | 4 +- netpbm-docfix.patch | 67 +- netpbm-gcc4.patch | 16 +- netpbm-manfix.patch | 167 ++-- netpbm-message.patch | 9 +- netpbm-nodoc.patch | 10 +- netpbm-noppmtompeg.patch | 14 +- netpbm-pnmtops.patch | 6 +- netpbm-ppmfadeusage.patch | 23 +- netpbm-ppmtopict.patch | 13 +- netpbm-security-code.patch | 1426 +++++++++++++++------------------- netpbm-werror.patch | 85 -- netpbm-xwdfix.patch | 8 +- netpbm.spec | 16 +- netpbm2tar.sh | 4 +- sources | 2 +- 21 files changed, 824 insertions(+), 1093 deletions(-) create mode 100644 netpbm-config.patch diff --git a/.gitignore b/.gitignore index 34e7179..bf6e343 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /netpbm-10.61.02.tar.xz /netpbm-10.66.02.tar.xz +/netpbm-10.71.02.tar.xz diff --git a/netpbm-CAN-2005-2471.patch b/netpbm-CAN-2005-2471.patch index ee9935f..06a55e8 100644 --- a/netpbm-CAN-2005-2471.patch +++ b/netpbm-CAN-2005-2471.patch @@ -1,7 +1,8 @@ -diff -up netpbm-10.56.03/converter/other/pstopnm.c.CAN-2005-2471 netpbm-10.56.03/converter/other/pstopnm.c ---- netpbm-10.56.03/converter/other/pstopnm.c.CAN-2005-2471 2011-11-09 09:18:00.000000000 +0100 -+++ netpbm-10.56.03/converter/other/pstopnm.c 2011-11-11 11:43:51.827409226 +0100 -@@ -747,11 +747,11 @@ execGhostscript(int const input +diff --git a/converter/other/pstopnm.c b/converter/other/pstopnm.c +index b253442..dca141f 100644 +--- a/converter/other/pstopnm.c ++++ b/converter/other/pstopnm.c +@@ -811,11 +811,11 @@ execGhostscript(int const inputPipeFd, ghostscriptProg, arg0, deviceopt, outfileopt, gopt, ropt, textalphabitsopt, "-q", "-dNOPAUSE", diff --git a/netpbm-bmptopnm.patch b/netpbm-bmptopnm.patch index 9095427..dedc4e7 100644 --- a/netpbm-bmptopnm.patch +++ b/netpbm-bmptopnm.patch @@ -1,6 +1,8 @@ ---- netpbm-10.35/converter/other/bmptopnm.c.bmptopnm 2007-01-29 13:08:46.000000000 +0100 -+++ netpbm-10.35/converter/other/bmptopnm.c 2007-01-29 13:32:21.000000000 +0100 -@@ -1262,7 +1262,7 @@ readBmp(FILE * const ifP, +diff --git a/converter/other/bmptopnm.c b/converter/other/bmptopnm.c +index a069092..20a0331 100644 +--- a/converter/other/bmptopnm.c ++++ b/converter/other/bmptopnm.c +@@ -1328,7 +1328,7 @@ readBmp(FILE * const ifP, xel ** const colormapP, bool const verbose) { diff --git a/netpbm-cmuwtopbm.patch b/netpbm-cmuwtopbm.patch index f5b328b..6a92971 100644 --- a/netpbm-cmuwtopbm.patch +++ b/netpbm-cmuwtopbm.patch @@ -1,6 +1,7 @@ -diff -up netpbm-10.61.01/converter/pbm/cmuwmtopbm.c.cmuwtopbmfix netpbm-10.61.01/converter/pbm/cmuwmtopbm.c ---- netpbm-10.61.01/converter/pbm/cmuwmtopbm.c.cmuwtopbmfix 2013-01-02 18:39:57.000000000 +0100 -+++ netpbm-10.61.01/converter/pbm/cmuwmtopbm.c 2013-01-03 05:41:36.024984241 +0100 +diff --git a/converter/pbm/cmuwmtopbm.c b/converter/pbm/cmuwmtopbm.c +index ccf8cfc..1f9bc6c 100644 +--- a/converter/pbm/cmuwmtopbm.c ++++ b/converter/pbm/cmuwmtopbm.c @@ -18,7 +18,7 @@ This program does not check the pad bits at the end of each row. */ @@ -10,7 +11,7 @@ diff -up netpbm-10.61.01/converter/pbm/cmuwmtopbm.c.cmuwtopbmfix netpbm-10.61.01 #include "pbm.h" /*-------------------------- -@@ -42,7 +42,7 @@ readCmuwmHeader(FILE * const ifP +@@ -42,7 +42,7 @@ readCmuwmHeader(FILE * const ifP, "CMU window manager header EOF / read error"; uint32_t const cmuwmMagic = 0xf10040bb; diff --git a/netpbm-config.patch b/netpbm-config.patch new file mode 100644 index 0000000..5a5bdbe --- /dev/null +++ b/netpbm-config.patch @@ -0,0 +1,20 @@ +diff --git a/config.mk.in b/config.mk.in +index 5910146..bd1c70b 100644 +--- a/config.mk.in ++++ b/config.mk.in +@@ -476,12 +476,12 @@ JBIGLIB = $(INTERNAL_JBIGLIB) + JBIGHDR_DIR = $(INTERNAL_JBIGHDR_DIR) + + # The Jasper JPEG-2000 image compression library (aka JasPer): +-JASPERLIB = $(INTERNAL_JASPERLIB) +-JASPERHDR_DIR = $(INTERNAL_JASPERHDR_DIR) ++JASPERLIB = "" ++JASPERHDR_DIR = "/usr/include/jasper" + # JASPERDEPLIBS is the libraries (-l options or file names) on which + # The Jasper library depends -- i.e. what you have to link into any + # executable that links in the Jasper library. +-JASPERDEPLIBS = ++JASPERDEPLIBS = -ljasper + #JASPERDEPLIBS = -ljpeg + + # And the Utah Raster Toolkit (aka URT aka RLE) library: diff --git a/netpbm-disable-pbmtog3.patch b/netpbm-disable-pbmtog3.patch index 7fb3ef6..0c10584 100644 --- a/netpbm-disable-pbmtog3.patch +++ b/netpbm-disable-pbmtog3.patch @@ -1,8 +1,8 @@ diff --git a/test/Test-Order b/test/Test-Order -index ff4b985..7ef1d97 100644 +index d21b9e8..133a48d 100644 --- a/test/Test-Order +++ b/test/Test-Order -@@ -74,7 +74,7 @@ symmetry.test +@@ -79,7 +79,7 @@ symmetry.test # Format converter tests diff --git a/netpbm-docfix.patch b/netpbm-docfix.patch index a88c65b..e11fe6a 100644 --- a/netpbm-docfix.patch +++ b/netpbm-docfix.patch @@ -1,19 +1,21 @@ -diff -up netpbm-10.35.58/converter/pbm/pbmtoepson.c.docfix netpbm-10.35.58/converter/pbm/pbmtoepson.c ---- netpbm-10.35.58/converter/pbm/pbmtoepson.c.docfix 2009-01-19 09:24:03.000000000 +0100 -+++ netpbm-10.35.58/converter/pbm/pbmtoepson.c 2009-04-15 09:10:52.000000000 +0200 -@@ -74,7 +74,7 @@ parseCommandLine(int arg - &dpiSpec, 0); - OPTENT3(0, "adjacent", OPT_FLAG, NULL, +diff --git a/converter/pbm/pbmtoepson.c b/converter/pbm/pbmtoepson.c +index bb36791..79d9ece 100644 +--- a/converter/pbm/pbmtoepson.c ++++ b/converter/pbm/pbmtoepson.c +@@ -74,7 +74,7 @@ parseCommandLine(int argc, + &dpiSpec, 0); + OPTENT3(0, "adjacent", OPT_FLAG, NULL, &adjacentSpec, 0); -- OPTENT3(0, "nonadjacent", OPT_FLAG, NULL, -+ OPTENT3(0, "noadjacent", OPT_FLAG, NULL, - &nonadjacentSpec, 0); +- OPTENT3(0, "nonadjacent", OPT_FLAG, NULL, ++ OPTENT3(0, "noadjacent", OPT_FLAG, NULL, + &nonadjacentSpec, 0); opt.opt_table = option_def; -diff -up netpbm-10.35.58/userguide/cameratopam.html.docfix netpbm-10.35.58/userguide/cameratopam.html ---- netpbm-10.35.58/userguide/cameratopam.html.docfix 2009-01-19 09:24:18.000000000 +0100 -+++ netpbm-10.35.58/userguide/cameratopam.html 2009-04-15 09:16:16.000000000 +0200 -@@ -25,10 +25,10 @@ cameratopam - convert raw camera image t +diff --git a/userguide/cameratopam.html b/userguide/cameratopam.html +index 4a34817..f26338f 100644 +--- a/userguide/cameratopam.html ++++ b/userguide/cameratopam.html +@@ -25,10 +25,10 @@ cameratopam - convert raw camera image to PAM [-balance_camera] [-red_scale=float] [-blue_scale=float] @@ -35,7 +37,7 @@ diff -up netpbm-10.35.58/userguide/cameratopam.html.docfix netpbm-10.35.58/userg
Change the output brightness. Default is 1.0. -@@ -114,14 +114,14 @@ channels by these values. Both default +@@ -114,14 +114,14 @@ channels by these values. Both default to 1.0.
By default, cameratoapm clips all colors to prevent pink hues in the highlights. Combine this option with @@ -52,10 +54,11 @@ diff -up netpbm-10.35.58/userguide/cameratopam.html.docfix netpbm-10.35.58/userg
For cameras based on the Fuji Super CCD SR, this option causes cameratopam to use the secondary sensors, in effect -diff -up netpbm-10.35.58/userguide/fiascotopnm.html.docfix netpbm-10.35.58/userguide/fiascotopnm.html ---- netpbm-10.35.58/userguide/fiascotopnm.html.docfix 2009-01-19 09:24:18.000000000 +0100 -+++ netpbm-10.35.58/userguide/fiascotopnm.html 2009-04-15 09:10:52.000000000 +0200 -@@ -51,7 +51,7 @@ the output file(s) are written to the fi +diff --git a/userguide/fiascotopnm.html b/userguide/fiascotopnm.html +index d8e2551..1747ad3 100644 +--- a/userguide/fiascotopnm.html ++++ b/userguide/fiascotopnm.html +@@ -51,7 +51,7 @@ the output file(s) are written to the first (writable) directory of this list. Otherwise, the current directory is used to store the output file(s). @@ -64,7 +67,7 @@ diff -up netpbm-10.35.58/userguide/fiascotopnm.html.docfix netpbm-10.35.58/userg
Decompress images in the 4:2:0 format; i.e., each chroma channel is decompressed to an image of halved width and height. Use this option -@@ -83,7 +83,7 @@ given amount N. N is 1 (mi +@@ -83,7 +83,7 @@ given amount N. N is 1 (minimum) to 100 (maximum); default is 70. When N=0, then the smoothing amount specified in the FIASCO file is used (defined by the FIASCO coder). @@ -73,7 +76,7 @@ diff -up netpbm-10.35.58/userguide/fiascotopnm.html.docfix netpbm-10.35.58/userg
Set number of frames per second to N. When using this option, the frame rate specified in the FIASCO file is overridden. -@@ -109,13 +109,9 @@ following methods (in the specified orde +@@ -113,13 +113,9 @@ following methods (in the specified order):
  • --config=name @@ -89,10 +92,11 @@ diff -up netpbm-10.35.58/userguide/fiascotopnm.html.docfix netpbm-10.35.58/userg -diff -up netpbm-10.47.12/userguide/pamperspective.html.docfix netpbm-10.47.12/userguide/pamperspective.html ---- netpbm-10.47.12/userguide/pamperspective.html.docfix 2010-04-27 15:48:09.000000000 +0200 -+++ netpbm-10.47.12/userguide/pamperspective.html 2010-05-03 14:16:26.064266675 +0200 -@@ -220,7 +220,7 @@ default rectangle as the "frame.&qu +diff --git a/userguide/pamperspective.html b/userguide/pamperspective.html +index 9f5e9f0..bb6cb58 100644 +--- a/userguide/pamperspective.html ++++ b/userguide/pamperspective.html +@@ -220,7 +220,7 @@ default rectangle as the "frame." The visible part is always a rectangle the axes of which are parallel to those of the frame.

    The frame options are additive. All the parts of the image @@ -101,10 +105,11 @@ diff -up netpbm-10.47.12/userguide/pamperspective.html.docfix netpbm-10.47.12/us --include (or their defaults) are in the visible part. The visible part is the smallest possible rectangle that contains the parts specified those three ways. -diff -up netpbm-10.47.12/userguide/pbmtoepson.html.docfix netpbm-10.47.12/userguide/pbmtoepson.html ---- netpbm-10.47.12/userguide/pbmtoepson.html.docfix 2010-04-27 15:48:09.000000000 +0200 -+++ netpbm-10.47.12/userguide/pbmtoepson.html 2010-05-03 14:34:03.571141020 +0200 -@@ -18,7 +18,7 @@ pbmtoepson - convert a PBM image into Ep +diff --git a/userguide/pbmtoepson.html b/userguide/pbmtoepson.html +index 6895d33..c0df7c4 100644 +--- a/userguide/pbmtoepson.html ++++ b/userguide/pbmtoepson.html +@@ -18,7 +18,7 @@ pbmtoepson - convert a PBM image into Epson printer graphics [-dpi=n] [-protocol={escp9|escp}] [-adjacent] @@ -113,12 +118,12 @@ diff -up netpbm-10.47.12/userguide/pbmtoepson.html.docfix netpbm-10.47.12/usergu [pbmfile] -@@ -74,7 +74,7 @@ print density for you consistent with yo +@@ -74,7 +74,7 @@ print density for you consistent with your other options.

    This option was new in Netpbm 10.23 (July 2004).

    -adjacent -
    -nonadjacent +
    -noadjacent -
    These options determine whether the output uses "adjacent dot - printing" or not, whatever that is. +
    These options determine whether the output uses "adjacent dot + printing" or not, whatever that is. diff --git a/netpbm-gcc4.patch b/netpbm-gcc4.patch index 3f51826..2557698 100644 --- a/netpbm-gcc4.patch +++ b/netpbm-gcc4.patch @@ -1,6 +1,7 @@ -diff -up netpbm-10.58.01/lib/pm.h.gcc4 netpbm-10.58.01/lib/pm.h ---- netpbm-10.58.01/lib/pm.h.gcc4 2012-04-09 19:08:08.885137097 +0200 -+++ netpbm-10.58.01/lib/pm.h 2012-04-09 19:08:08.894136984 +0200 +diff --git a/lib/pm.h b/lib/pm.h +index 47cbfe8..e9f1405 100644 +--- a/lib/pm.h ++++ b/lib/pm.h @@ -18,6 +18,7 @@ #include #include @@ -9,10 +10,11 @@ diff -up netpbm-10.58.01/lib/pm.h.gcc4 netpbm-10.58.01/lib/pm.h #include #include #include -diff -up netpbm-10.58.01/urt/rle.h.gcc4 netpbm-10.58.01/urt/rle.h ---- netpbm-10.58.01/urt/rle.h.gcc4 2012-04-09 19:08:08.000000000 +0200 -+++ netpbm-10.58.01/urt/rle.h 2012-04-09 19:08:39.137758887 +0200 -@@ -34,6 +34,7 @@ +diff --git a/urt/rle.h b/urt/rle.h +index 0766d22..8d72cb9 100644 +--- a/urt/rle.h ++++ b/urt/rle.h +@@ -31,6 +31,7 @@ #define RLE_H #include /* Declare FILE. */ diff --git a/netpbm-manfix.patch b/netpbm-manfix.patch index d459db4..c0885a1 100644 --- a/netpbm-manfix.patch +++ b/netpbm-manfix.patch @@ -1,10 +1,10 @@ -diff -up netpbm-10.59.03/userguide/avstopam.html.manfix netpbm-10.59.03/userguide/avstopam.html ---- netpbm-10.59.03/userguide/avstopam.html.manfix 2012-09-22 03:46:15.000000000 +0200 -+++ netpbm-10.59.03/userguide/avstopam.html 2012-09-25 10:47:22.756174816 +0200 +diff --git a/userguide/avstopam.html b/userguide/avstopam.html +index 9ec5e41..f69fdaa 100644 +--- a/userguide/avstopam.html ++++ b/userguide/avstopam.html @@ -1,8 +1,7 @@ -- + - -+ + Avstopam User Manual @@ -12,25 +12,22 @@ diff -up netpbm-10.59.03/userguide/avstopam.html.manfix netpbm-10.59.03/userguid -diff -up netpbm-10.59.03/userguide/escp2topbm.html.manfix netpbm-10.59.03/userguide/escp2topbm.html ---- netpbm-10.59.03/userguide/escp2topbm.html.manfix 2012-09-22 03:46:15.000000000 +0200 -+++ netpbm-10.59.03/userguide/escp2topbm.html 2012-09-25 10:47:22.756174816 +0200 -@@ -2,10 +2,11 @@ - Escp2topbm User Manual - -

    escp2topbm

    --Created: 1 August 2003 -+Updated: 1 August 2003 +diff --git a/userguide/escp2topbm.html b/userguide/escp2topbm.html +index 186e032..af35b06 100644 +--- a/userguide/escp2topbm.html ++++ b/userguide/escp2topbm.html +@@ -6,6 +6,7 @@ Updated: 14 July 2015
    Table Of Contents -+

    NAME

    ++

    NAME

    escp2topbm - convert an ESC/P2 printer file to a PBM image

    SYNOPSIS

    -diff -up netpbm-10.59.03/userguide/faxformat.html.manfix netpbm-10.59.03/userguide/faxformat.html ---- netpbm-10.59.03/userguide/faxformat.html.manfix 2012-09-22 03:46:15.000000000 +0200 -+++ netpbm-10.59.03/userguide/faxformat.html 2012-09-25 10:47:22.756174816 +0200 +diff --git a/userguide/faxformat.html b/userguide/faxformat.html +index cb5d710..cadd217 100644 +--- a/userguide/faxformat.html ++++ b/userguide/faxformat.html @@ -5,10 +5,12 @@ Updated: 03 December 2008
    @@ -44,9 +41,10 @@ diff -up netpbm-10.59.03/userguide/faxformat.html.manfix netpbm-10.59.03/usergui

    The ITU (formerly CCITT) publishes standards for operation of fax machines (the idea is to provide a way to be sure that a fax machine is able to receive a fax sent by another). These standards incidentally specify graphics file -diff -up netpbm-10.59.03/userguide/pampaintspill.html.manfix netpbm-10.59.03/userguide/pampaintspill.html ---- netpbm-10.59.03/userguide/pampaintspill.html.manfix 2012-09-22 03:46:15.000000000 +0200 -+++ netpbm-10.59.03/userguide/pampaintspill.html 2012-09-25 10:47:22.757174803 +0200 +diff --git a/userguide/pampaintspill.html b/userguide/pampaintspill.html +index c71db55..f62011f 100644 +--- a/userguide/pampaintspill.html ++++ b/userguide/pampaintspill.html @@ -1,8 +1,7 @@ - @@ -65,33 +63,12 @@ diff -up netpbm-10.59.03/userguide/pampaintspill.html.manfix netpbm-10.59.03/use

    pampaintspill - smoothly spill colors into the background

    SYNOPSIS

    -diff -up netpbm-10.59.03/userguide/pamrecolor.html.manfix netpbm-10.59.03/userguide/pamrecolor.html ---- netpbm-10.59.03/userguide/pamrecolor.html.manfix 2012-09-22 03:46:15.000000000 +0200 -+++ netpbm-10.59.03/userguide/pamrecolor.html 2012-09-25 10:47:22.757174803 +0200 -@@ -1,8 +1,7 @@ -- -+ - - - Pamrecolor User Manual -- - - - -@@ -11,7 +10,7 @@ - -

    Updated: 31 July 2010

    - --

    Table Of Contents

    -+

    Table Of Contents

    - - -

    NAME

    -diff -up netpbm-10.59.03/userguide/pamsistoaglyph.html.manfix netpbm-10.59.03/userguide/pamsistoaglyph.html ---- netpbm-10.59.03/userguide/pamsistoaglyph.html.manfix 2012-09-22 03:46:15.000000000 +0200 -+++ netpbm-10.59.03/userguide/pamsistoaglyph.html 2012-09-25 10:47:22.758174790 +0200 -@@ -1,8 +1,7 @@ - +diff --git a/userguide/pamsistoaglyph.html b/userguide/pamsistoaglyph.html +index 8487717..d17368b 100644 +--- a/userguide/pamsistoaglyph.html ++++ b/userguide/pamsistoaglyph.html +@@ -1,8 +1,6 @@ +- - + @@ -100,13 +77,34 @@ diff -up netpbm-10.59.03/userguide/pamsistoaglyph.html.manfix netpbm-10.59.03/us -diff -up netpbm-10.59.03/userguide/pamtoavs.html.manfix netpbm-10.59.03/userguide/pamtoavs.html ---- netpbm-10.59.03/userguide/pamtoavs.html.manfix 2012-09-22 03:46:15.000000000 +0200 -+++ netpbm-10.59.03/userguide/pamtoavs.html 2012-09-25 10:47:22.759174777 +0200 -@@ -1,8 +1,7 @@ -- -- +diff --git a/userguide/pamstereogram.html b/userguide/pamstereogram.html +index d5c3f83..a43fd5f 100644 +--- a/userguide/pamstereogram.html ++++ b/userguide/pamstereogram.html +@@ -1,5 +1,5 @@ +- +- + ++ + + Pamstereogram User Manual + +@@ -10,7 +10,7 @@ + +

    Updated: 19 June 2015

    + +-

    Table Of Contents

    ++

    Table Of Contents

    + + +

    NAME

    +diff --git a/userguide/pamtoavs.html b/userguide/pamtoavs.html +index 4f1b63e..0619e1b 100644 +--- a/userguide/pamtoavs.html ++++ b/userguide/pamtoavs.html +@@ -1,8 +1,7 @@ + +- + Pamtoavs User Manual @@ -114,13 +112,13 @@ diff -up netpbm-10.59.03/userguide/pamtoavs.html.manfix netpbm-10.59.03/userguid -diff -up netpbm-10.59.03/userguide/pamtooctaveimg.html.manfix netpbm-10.59.03/userguide/pamtooctaveimg.html ---- netpbm-10.59.03/userguide/pamtooctaveimg.html.manfix 2012-09-22 03:46:15.000000000 +0200 -+++ netpbm-10.59.03/userguide/pamtooctaveimg.html 2012-09-25 10:47:22.759174777 +0200 +diff --git a/userguide/pamtooctaveimg.html b/userguide/pamtooctaveimg.html +index 9cadc13..69b09cb 100644 +--- a/userguide/pamtooctaveimg.html ++++ b/userguide/pamtooctaveimg.html @@ -1,8 +1,7 @@ -- + - -+ + Pamtooctaveimg User Manual @@ -128,9 +126,10 @@ diff -up netpbm-10.59.03/userguide/pamtooctaveimg.html.manfix netpbm-10.59.03/us -diff -up netpbm-10.59.03/userguide/pnmflip.html.manfix netpbm-10.59.03/userguide/pnmflip.html ---- netpbm-10.59.03/userguide/pnmflip.html.manfix 2012-09-22 03:46:15.000000000 +0200 -+++ netpbm-10.59.03/userguide/pnmflip.html 2012-09-25 10:47:22.760174765 +0200 +diff --git a/userguide/pnmflip.html b/userguide/pnmflip.html +index 53c365c..eb0b896 100644 +--- a/userguide/pnmflip.html ++++ b/userguide/pnmflip.html @@ -4,9 +4,11 @@

    pnmflip

    @@ -143,9 +142,10 @@ diff -up netpbm-10.59.03/userguide/pnmflip.html.manfix netpbm-10.59.03/userguide

    pamflip is mostly backward compatible with pnmflip, but works on PAM images too. -diff -up netpbm-10.59.03/userguide/pnmmercator.html.manfix netpbm-10.59.03/userguide/pnmmercator.html ---- netpbm-10.59.03/userguide/pnmmercator.html.manfix 2012-09-22 03:46:15.000000000 +0200 -+++ netpbm-10.59.03/userguide/pnmmercator.html 2012-09-25 10:47:22.760174765 +0200 +diff --git a/userguide/pnmmercator.html b/userguide/pnmmercator.html +index e9e7165..9ac6c5b 100644 +--- a/userguide/pnmmercator.html ++++ b/userguide/pnmmercator.html @@ -1,7 +1,6 @@ - + @@ -155,18 +155,10 @@ diff -up netpbm-10.59.03/userguide/pnmmercator.html.manfix netpbm-10.59.03/userg PnmMercator User Manual -diff -up netpbm-10.59.03/userguide/pnmtotiff.html.manfix netpbm-10.59.03/userguide/pnmtotiff.html ---- netpbm-10.59.03/userguide/pnmtotiff.html.manfix 2012-09-22 03:46:15.000000000 +0200 -+++ netpbm-10.59.03/userguide/pnmtotiff.html 2012-09-25 10:47:22.760174765 +0200 -@@ -1,5 +1,4 @@ - -- - - pnmtotiff - -diff -up netpbm-10.59.03/userguide/ppmtogif.html.manfix netpbm-10.59.03/userguide/ppmtogif.html ---- netpbm-10.59.03/userguide/ppmtogif.html.manfix 2012-09-22 03:46:15.000000000 +0200 -+++ netpbm-10.59.03/userguide/ppmtogif.html 2012-09-25 10:47:22.761174753 +0200 +diff --git a/userguide/ppmtogif.html b/userguide/ppmtogif.html +index 84b5163..1d33072 100644 +--- a/userguide/ppmtogif.html ++++ b/userguide/ppmtogif.html @@ -4,11 +4,14 @@

    ppmtogif

    @@ -182,24 +174,3 @@ diff -up netpbm-10.59.03/userguide/ppmtogif.html.manfix netpbm-10.59.03/userguid

    One way pamtogif is not backward compatible with ppmtogif is that to specify a transparency (alpha) mask with ppmtogif, you supply the transparency as a separate pseudo-PGM image and use the -diff -up netpbm-10.61.02/userguide/pamstereogram.html.manfix netpbm-10.61.02/userguide/pamstereogram.html ---- netpbm-10.61.02/userguide/pamstereogram.html.manfix 2013-02-20 07:32:26.000000000 +0100 -+++ netpbm-10.61.02/userguide/pamstereogram.html 2013-02-20 07:40:35.071099535 +0100 -@@ -1,5 +1,5 @@ -- -- -+ -+ - - Pamstereogram User Manual - -@@ -10,8 +10,7 @@ - -

    Updated:30 December 2012

    - --

    Table Of Contents

    -- -+

    Table Of Contents

    - -

    NAME

    - diff --git a/netpbm-message.patch b/netpbm-message.patch index 0a820fc..1df6865 100644 --- a/netpbm-message.patch +++ b/netpbm-message.patch @@ -1,7 +1,8 @@ -diff -up netpbm-10.59.01/converter/other/giftopnm.c.message netpbm-10.59.01/converter/other/giftopnm.c ---- netpbm-10.59.01/converter/other/giftopnm.c.message 2012-07-11 05:54:52.000000000 +0200 -+++ netpbm-10.59.01/converter/other/giftopnm.c 2012-07-11 05:57:57.745246980 +0200 -@@ -2038,7 +2038,7 @@ convertImages(FILE * const ifP, +diff --git a/converter/other/giftopnm.c b/converter/other/giftopnm.c +index 2e6ae1d..be4655f 100644 +--- a/converter/other/giftopnm.c ++++ b/converter/other/giftopnm.c +@@ -2086,7 +2086,7 @@ convertImages(FILE * const ifP, imageSeq, imageSeq > 1 ? "s" : ""); } else { if (verbose) diff --git a/netpbm-nodoc.patch b/netpbm-nodoc.patch index c35cd9e..49a06c1 100644 --- a/netpbm-nodoc.patch +++ b/netpbm-nodoc.patch @@ -1,13 +1,13 @@ diff --git a/GNUmakefile b/GNUmakefile -index b0b7f00..a46329d 100644 +index caf8e37..4418076 100644 --- a/GNUmakefile +++ b/GNUmakefile -@@ -369,7 +369,7 @@ install.lib: +@@ -394,7 +394,7 @@ install.lib: endif .PHONY: install.manwebmain --install.manwebmain: $(PKGDIR)/man/web/netpbm.url $(PKGDIR)/bin/doc.url -+install.manwebmain: $(PKGDIR)/man/web/netpbm.url +-install.manwebmain: $(PKGDIR)/$(PKGMANDIR)/web/netpbm.url $(PKGDIR)/bin/doc.url ++install.manwebmain: $(PKGDIR)/$(PKGMANDIR)/web/netpbm.url - $(PKGDIR)/man/web/netpbm.url: $(PKGDIR)/man/web + $(PKGDIR)/$(PKGMANDIR)/web/netpbm.url: $(PKGDIR)/$(PKGMANDIR)/web echo "$(NETPBM_DOCURL)" > $@ diff --git a/netpbm-noppmtompeg.patch b/netpbm-noppmtompeg.patch index 58b7fa8..8b668da 100644 --- a/netpbm-noppmtompeg.patch +++ b/netpbm-noppmtompeg.patch @@ -1,6 +1,7 @@ -diff -up netpbm-10.47.12/buildtools/manpage.mk.noppmtompeg netpbm-10.47.12/buildtools/manpage.mk ---- netpbm-10.47.12/buildtools/manpage.mk.noppmtompeg 2010-04-27 09:54:52.121522491 -0400 -+++ netpbm-10.47.12/buildtools/manpage.mk 2010-04-27 09:55:10.337642487 -0400 +diff --git a/buildtools/manpage.mk b/buildtools/manpage.mk +index 47d890c..62e613f 100644 +--- a/buildtools/manpage.mk ++++ b/buildtools/manpage.mk @@ -251,7 +251,6 @@ MAN1 = \ ppmtolj.1 \ ppmtomap.1 \ @@ -9,9 +10,10 @@ diff -up netpbm-10.47.12/buildtools/manpage.mk.noppmtompeg netpbm-10.47.12/build ppmtoneo.1 \ ppmtopcx.1 \ ppmtopgm.1 \ -diff -up netpbm-10.47.12/converter/ppm/Makefile.noppmtompeg netpbm-10.47.12/converter/ppm/Makefile ---- netpbm-10.47.12/converter/ppm/Makefile.noppmtompeg 2010-04-27 09:55:20.293517254 -0400 -+++ netpbm-10.47.12/converter/ppm/Makefile 2010-04-27 09:55:41.534642567 -0400 +diff --git a/converter/ppm/Makefile b/converter/ppm/Makefile +index 003ef8d..09f05cd 100644 +--- a/converter/ppm/Makefile ++++ b/converter/ppm/Makefile @@ -7,7 +7,7 @@ VPATH=.:$(SRCDIR)/$(SUBDIR) include $(BUILDDIR)/config.mk diff --git a/netpbm-pnmtops.patch b/netpbm-pnmtops.patch index 31bce9e..9145afc 100644 --- a/netpbm-pnmtops.patch +++ b/netpbm-pnmtops.patch @@ -1,5 +1,5 @@ diff --git a/converter/other/Makefile b/converter/other/Makefile -index 7aefda1..0d998f6 100644 +index f51a780..9df16bc 100644 --- a/converter/other/Makefile +++ b/converter/other/Makefile @@ -121,7 +121,7 @@ PORTBINARIES = avstopam bmptopnm fitstopnm \ @@ -7,7 +7,7 @@ index 7aefda1..0d998f6 100644 pbmtopgm pdbimgtopam pfmtopam \ pgmtopbm pgmtoppm ppmtopgm pnmtoddif \ - pnmtopclxl pnmtorast \ -+ pnmtopclxl pnmtops pnmtorast \ ++ pnmtopclxl pnmtops pnmtorast \ pnmtosgi pnmtosir pamtotga pnmtoxwd \ rasttopnm rlatopam sgitopnm sirtopnm srftopam sunicontopnm \ - winicontopam xwdtopnm zeisstopnm + winicontopam xwdtopnm yuy2topam zeisstopnm diff --git a/netpbm-ppmfadeusage.patch b/netpbm-ppmfadeusage.patch index 88ad44c..2dc721a 100644 --- a/netpbm-ppmfadeusage.patch +++ b/netpbm-ppmfadeusage.patch @@ -1,7 +1,8 @@ -diff -up netpbm-10.47.09/editor/ppmfade.ppmfadeusage netpbm-10.47.09/editor/ppmfade ---- netpbm-10.47.09/editor/ppmfade.ppmfadeusage 2010-02-17 11:22:02.000000000 +0100 -+++ netpbm-10.47.09/editor/ppmfade 2010-02-17 11:27:29.000000000 +0100 -@@ -34,7 +34,6 @@ my $base_name = "fade"; # default base +diff --git a/editor/ppmfade b/editor/ppmfade +index 8eb094f..adcdb6d 100755 +--- a/editor/ppmfade ++++ b/editor/ppmfade +@@ -60,7 +60,6 @@ my $base_name = "fade"; # default base name of output files my $image = "ppm"; # default output storage format my $mode = $SPREAD; # default fading mode @@ -9,7 +10,7 @@ diff -up netpbm-10.47.09/editor/ppmfade.ppmfadeusage netpbm-10.47.09/editor/ppmf my $n; # argument number for ($n = 0; $n < @ARGV; $n++) { -@@ -44,7 +43,7 @@ for ($n = 0; $n < @ARGV; $n++) { +@@ -70,7 +69,7 @@ for ($n = 0; $n < @ARGV; $n++) { if (-e $first_file) { } else { print "I can't find first file '$first_file'\n"; @@ -18,7 +19,7 @@ diff -up netpbm-10.47.09/editor/ppmfade.ppmfadeusage netpbm-10.47.09/editor/ppmf } } elsif ($ARGV[$n] eq "-l") { $n++; -@@ -52,7 +51,7 @@ for ($n = 0; $n < @ARGV; $n++) { +@@ -78,7 +77,7 @@ for ($n = 0; $n < @ARGV; $n++) { if (-e $last_file) { } else { print "I can't find last file '$last_file'\n"; @@ -27,7 +28,7 @@ diff -up netpbm-10.47.09/editor/ppmfade.ppmfadeusage netpbm-10.47.09/editor/ppmf } } elsif ($ARGV[$n] eq "-base") { $n++; -@@ -73,11 +72,12 @@ for ($n = 0; $n < @ARGV; $n++) { +@@ -99,11 +98,12 @@ for ($n = 0; $n < @ARGV; $n++) { $mode = $BLOCK; } elsif ("$ARGV[$n]" eq "-mix") { $mode = $MIX; @@ -43,12 +44,12 @@ diff -up netpbm-10.47.09/editor/ppmfade.ppmfadeusage netpbm-10.47.09/editor/ppmf } } # -@@ -96,18 +96,18 @@ if ($first_file ne "undefined") { +@@ -122,18 +122,18 @@ if ($first_file ne "undefined") { $width = $1; $height = $2; } else { print("Unrecognized results from pnmfile on $first_file.\n"); - exit(50); -+ exit 1; ++ exit(1); } } elsif ($last_file ne "undefined") { if ((`pnmfile $last_file` =~ m{\b(\d+)\sby\s(\d+)} )) { @@ -56,12 +57,12 @@ diff -up netpbm-10.47.09/editor/ppmfade.ppmfadeusage netpbm-10.47.09/editor/ppmf } else { print("Unrecognized results from pnmfile on $first_file.\n"); - exit(50); -+ exit 1; ++ exit(1); } } else { print("ppmfade: You must specify -f or -l (or both)\n"); - exit(90); -+ exit 1; ++ exit(1); } print("Frames are " . $width . "W x " . $height . "H\n"); diff --git a/netpbm-ppmtopict.patch b/netpbm-ppmtopict.patch index 97b7d2b..8e562c3 100644 --- a/netpbm-ppmtopict.patch +++ b/netpbm-ppmtopict.patch @@ -1,10 +1,11 @@ -diff -up netpbm-10.58.01/converter/ppm/ppmtopict.c.ppmtopict netpbm-10.58.01/converter/ppm/ppmtopict.c ---- netpbm-10.58.01/converter/ppm/ppmtopict.c.ppmtopict 2012-06-13 09:52:42.000000000 +0200 -+++ netpbm-10.58.01/converter/ppm/ppmtopict.c 2012-06-13 11:33:11.134747363 +0200 -@@ -200,7 +200,7 @@ putRow(FILE * const ifP, - pixel * const rowpixels, - char * const packed) { +diff --git a/converter/ppm/ppmtopict.c b/converter/ppm/ppmtopict.c +index 36464b6..034e705 100644 +--- a/converter/ppm/ppmtopict.c ++++ b/converter/ppm/ppmtopict.c +@@ -208,7 +208,7 @@ putRow(FILE * const ofP, + Use buffer 'outBuf'. + -----------------------------------------------------------------------------*/ - unsigned int i; + int i; unsigned int count; diff --git a/netpbm-security-code.patch b/netpbm-security-code.patch index 927773a..cd38edb 100644 --- a/netpbm-security-code.patch +++ b/netpbm-security-code.patch @@ -1,16 +1,17 @@ -diff -up netpbm-10.58.01/analyzer/pgmtexture.c.security-code netpbm-10.58.01/analyzer/pgmtexture.c ---- netpbm-10.58.01/analyzer/pgmtexture.c.security-code 2012-04-09 15:31:32.000000000 +0200 -+++ netpbm-10.58.01/analyzer/pgmtexture.c 2012-04-09 15:40:03.183620040 +0200 -@@ -97,7 +97,7 @@ vector(unsigned int const nl, - float * v; +diff --git a/analyzer/pgmtexture.c b/analyzer/pgmtexture.c +index 0731733..635c58b 100644 +--- a/analyzer/pgmtexture.c ++++ b/analyzer/pgmtexture.c +@@ -98,6 +98,8 @@ vector(unsigned int const nl, assert(nh >= nl); -- + + overflow_add(nh - nl, 1); ++ MALLOCARRAY(v, (unsigned) (nh - nl + 1)); if (v == NULL) -@@ -129,6 +129,7 @@ matrix (unsigned int const nrl, +@@ -129,6 +131,7 @@ matrix (unsigned int const nrl, assert(nrh >= nrl); /* allocate pointers to rows */ @@ -18,18 +19,18 @@ diff -up netpbm-10.58.01/analyzer/pgmtexture.c.security-code netpbm-10.58.01/ana MALLOCARRAY(m, (unsigned) (nrh - nrl + 1)); if (m == NULL) pm_error("Unable to allocate memory for a matrix."); -@@ -136,7 +137,7 @@ matrix (unsigned int const nrl, - m -= ncl; +@@ -137,6 +140,7 @@ matrix (unsigned int const nrl, assert (nch >= ncl); -- + + overflow_add(nch - ncl, 1); /* allocate rows and set pointers to them */ for (i = nrl; i <= nrh; ++i) { MALLOCARRAY(m[i], (unsigned) (nch - ncl + 1)); -diff -up netpbm-10.58.01/converter/other/gemtopnm.c.security-code netpbm-10.58.01/converter/other/gemtopnm.c ---- netpbm-10.58.01/converter/other/gemtopnm.c.security-code 2012-04-09 15:31:42.000000000 +0200 -+++ netpbm-10.58.01/converter/other/gemtopnm.c 2012-04-09 15:40:03.183620040 +0200 +diff --git a/converter/other/gemtopnm.c b/converter/other/gemtopnm.c +index aac7479..5f1a51a 100644 +--- a/converter/other/gemtopnm.c ++++ b/converter/other/gemtopnm.c @@ -106,6 +106,7 @@ main(argc, argv) pnm_writepnminit( stdout, cols, rows, MAXVAL, type, 0 ); @@ -38,10 +39,11 @@ diff -up netpbm-10.58.01/converter/other/gemtopnm.c.security-code netpbm-10.58.0 { /* allocate input row data structure */ int plane; -diff -up netpbm-10.58.01/converter/other/jpegtopnm.c.security-code netpbm-10.58.01/converter/other/jpegtopnm.c ---- netpbm-10.58.01/converter/other/jpegtopnm.c.security-code 2012-04-09 15:31:40.000000000 +0200 -+++ netpbm-10.58.01/converter/other/jpegtopnm.c 2012-04-09 15:40:03.184620028 +0200 -@@ -861,6 +861,8 @@ convertImage(FILE * +diff --git a/converter/other/jpegtopnm.c b/converter/other/jpegtopnm.c +index ab3b18e..c324b86 100644 +--- a/converter/other/jpegtopnm.c ++++ b/converter/other/jpegtopnm.c +@@ -861,6 +861,8 @@ convertImage(FILE * const ofP, /* Calculate output image dimensions so we can allocate space */ jpeg_calc_output_dimensions(cinfoP); @@ -50,9 +52,10 @@ diff -up netpbm-10.58.01/converter/other/jpegtopnm.c.security-code netpbm-10.58. /* Start decompressor */ jpeg_start_decompress(cinfoP); -diff -up netpbm-10.58.01/converter/other/pbmtopgm.c.security-code netpbm-10.58.01/converter/other/pbmtopgm.c ---- netpbm-10.58.01/converter/other/pbmtopgm.c.security-code 2012-04-09 15:31:42.000000000 +0200 -+++ netpbm-10.58.01/converter/other/pbmtopgm.c 2012-04-09 15:40:03.184620028 +0200 +diff --git a/converter/other/pbmtopgm.c b/converter/other/pbmtopgm.c +index 69b20fb..382a487 100644 +--- a/converter/other/pbmtopgm.c ++++ b/converter/other/pbmtopgm.c @@ -47,6 +47,7 @@ main(int argc, char *argv[]) { "than the image height (%u rows)", height, rows); @@ -61,9 +64,10 @@ diff -up netpbm-10.58.01/converter/other/pbmtopgm.c.security-code netpbm-10.58.0 maxval = MIN(PGM_OVERALLMAXVAL, width*height); pgm_writepgminit(stdout, cols, rows, maxval, 0) ; -diff -up netpbm-10.58.01/converter/other/pnmtoddif.c.security-code netpbm-10.58.01/converter/other/pnmtoddif.c ---- netpbm-10.58.01/converter/other/pnmtoddif.c.security-code 2012-04-09 15:31:42.000000000 +0200 -+++ netpbm-10.58.01/converter/other/pnmtoddif.c 2012-04-09 15:40:03.185620015 +0200 +diff --git a/converter/other/pnmtoddif.c b/converter/other/pnmtoddif.c +index ae8c852..9ee037b 100644 +--- a/converter/other/pnmtoddif.c ++++ b/converter/other/pnmtoddif.c @@ -632,6 +632,7 @@ main(int argc, char *argv[]) { switch (PNM_FORMAT_TYPE(format)) { case PBM_TYPE: @@ -80,10 +84,11 @@ diff -up netpbm-10.58.01/converter/other/pnmtoddif.c.security-code netpbm-10.58. ip.bytes_per_line = 3 * cols; ip.bits_per_pixel = 24; ip.spectral = 5; -diff -up netpbm-10.58.01/converter/other/pnmtojpeg.c.security-code netpbm-10.58.01/converter/other/pnmtojpeg.c ---- netpbm-10.58.01/converter/other/pnmtojpeg.c.security-code 2012-04-09 15:31:39.000000000 +0200 -+++ netpbm-10.58.01/converter/other/pnmtojpeg.c 2012-04-09 15:40:03.186620002 +0200 -@@ -605,7 +605,11 @@ read_scan_script(j_compress_ptr const ci +diff --git a/converter/other/pnmtojpeg.c b/converter/other/pnmtojpeg.c +index ce231c9..1279040 100644 +--- a/converter/other/pnmtojpeg.c ++++ b/converter/other/pnmtojpeg.c +@@ -605,7 +605,11 @@ read_scan_script(j_compress_ptr const cinfo, want JPOOL_PERMANENT. */ const unsigned int scan_info_size = nscans * sizeof(jpeg_scan_info); @@ -96,7 +101,7 @@ diff -up netpbm-10.58.01/converter/other/pnmtojpeg.c.security-code netpbm-10.58. (jpeg_scan_info *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, scan_info_size); -@@ -937,6 +941,8 @@ compute_rescaling_array(JSAMPLE ** const +@@ -937,6 +941,8 @@ compute_rescaling_array(JSAMPLE ** const rescale_p, const pixval maxval, const long half_maxval = maxval / 2; long val; @@ -105,7 +110,7 @@ diff -up netpbm-10.58.01/converter/other/pnmtojpeg.c.security-code netpbm-10.58. *rescale_p = (JSAMPLE *) (cinfo.mem->alloc_small) ((j_common_ptr) &cinfo, JPOOL_IMAGE, (size_t) (((long) maxval + 1L) * -@@ -1015,6 +1021,7 @@ convert_scanlines(struct jpeg_compress_s +@@ -1015,6 +1021,7 @@ convert_scanlines(struct jpeg_compress_struct * const cinfo_p, */ /* Allocate the libpnm output and compressor input buffers */ @@ -113,10 +118,11 @@ diff -up netpbm-10.58.01/converter/other/pnmtojpeg.c.security-code netpbm-10.58. buffer = (*cinfo_p->mem->alloc_sarray) ((j_common_ptr) cinfo_p, JPOOL_IMAGE, (unsigned int) cinfo_p->image_width * cinfo_p->input_components, -diff -up netpbm-10.58.01/converter/other/pnmtops.c.security-code netpbm-10.58.01/converter/other/pnmtops.c ---- netpbm-10.58.01/converter/other/pnmtops.c.security-code 2012-04-09 15:31:40.000000000 +0200 -+++ netpbm-10.58.01/converter/other/pnmtops.c 2012-04-09 15:40:03.187619989 +0200 -@@ -256,17 +256,21 @@ parseCommandLine(int argc, const char ** +diff --git a/converter/other/pnmtops.c b/converter/other/pnmtops.c +index 6cd6be9..8a7d25a 100644 +--- a/converter/other/pnmtops.c ++++ b/converter/other/pnmtops.c +@@ -292,17 +292,21 @@ parseCommandLine(int argc, const char ** argv, validateCompDimension(width, 72, "-width value"); validateCompDimension(height, 72, "-height value"); @@ -139,9 +145,10 @@ diff -up netpbm-10.58.01/converter/other/pnmtops.c.security-code netpbm-10.58.01 cmdlineP->imageheight = imageheight * 72; } else -diff -up netpbm-10.58.01/converter/other/rletopnm.c.security-code netpbm-10.58.01/converter/other/rletopnm.c ---- netpbm-10.58.01/converter/other/rletopnm.c.security-code 2012-04-09 15:31:42.000000000 +0200 -+++ netpbm-10.58.01/converter/other/rletopnm.c 2012-04-09 15:40:03.189619963 +0200 +diff --git a/converter/other/rletopnm.c b/converter/other/rletopnm.c +index 9995914..058278c 100644 +--- a/converter/other/rletopnm.c ++++ b/converter/other/rletopnm.c @@ -19,6 +19,8 @@ * If you modify this software, you should include a notice giving the * name of the person performing the modification, the date of modification, @@ -151,9 +158,10 @@ diff -up netpbm-10.58.01/converter/other/rletopnm.c.security-code netpbm-10.58.0 */ /* * rletopnm - A conversion program to convert from Utah's "rle" image format -diff -up netpbm-10.58.01/converter/other/sirtopnm.c.security-code netpbm-10.58.01/converter/other/sirtopnm.c ---- netpbm-10.58.01/converter/other/sirtopnm.c.security-code 2012-04-09 15:31:42.000000000 +0200 -+++ netpbm-10.58.01/converter/other/sirtopnm.c 2012-04-09 15:40:03.190619951 +0200 +diff --git a/converter/other/sirtopnm.c b/converter/other/sirtopnm.c +index fafcc91..9fe49d0 100644 +--- a/converter/other/sirtopnm.c ++++ b/converter/other/sirtopnm.c @@ -69,6 +69,7 @@ char* argv[]; } break; @@ -162,10 +170,11 @@ diff -up netpbm-10.58.01/converter/other/sirtopnm.c.security-code netpbm-10.58.0 picsize = cols * rows * 3; planesize = cols * rows; if ( !( sirarray = (unsigned char*) malloc( picsize ) ) ) -diff -up netpbm-10.58.01/converter/other/tifftopnm.c.security-code netpbm-10.58.01/converter/other/tifftopnm.c ---- netpbm-10.58.01/converter/other/tifftopnm.c.security-code 2012-04-09 15:31:42.000000000 +0200 -+++ netpbm-10.58.01/converter/other/tifftopnm.c 2012-04-09 15:40:03.191619939 +0200 -@@ -1279,7 +1279,9 @@ convertRasterByRows(pnmOut * const +diff --git a/converter/other/tifftopnm.c b/converter/other/tifftopnm.c +index 0d6494f..19e9e38 100644 +--- a/converter/other/tifftopnm.c ++++ b/converter/other/tifftopnm.c +@@ -1309,7 +1309,9 @@ convertRasterByRows(pnmOut * const pnmOutP, if (scanbuf == NULL) pm_error("can't allocate memory for scanline buffer"); @@ -176,10 +185,11 @@ diff -up netpbm-10.58.01/converter/other/tifftopnm.c.security-code netpbm-10.58. if (samplebuf == NULL) pm_error("can't allocate memory for row buffer"); -diff -up netpbm-10.58.01/converter/other/xwdtopnm.c.security-code netpbm-10.58.01/converter/other/xwdtopnm.c ---- netpbm-10.58.01/converter/other/xwdtopnm.c.security-code 2012-04-09 15:31:40.000000000 +0200 -+++ netpbm-10.58.01/converter/other/xwdtopnm.c 2012-04-09 15:40:03.192619927 +0200 -@@ -209,6 +209,10 @@ processX10Header(X10WDFileHeader * cons +diff --git a/converter/other/xwdtopnm.c b/converter/other/xwdtopnm.c +index 45d66b4..c914481 100644 +--- a/converter/other/xwdtopnm.c ++++ b/converter/other/xwdtopnm.c +@@ -209,6 +209,10 @@ processX10Header(X10WDFileHeader * const h10P, *colorsP = pnm_allocrow(2); PNM_ASSIGN1((*colorsP)[0], 0); PNM_ASSIGN1((*colorsP)[1], *maxvalP); @@ -190,7 +200,7 @@ diff -up netpbm-10.58.01/converter/other/xwdtopnm.c.security-code netpbm-10.58.0 *padrightP = (((h10P->pixmap_width + 15) / 16) * 16 - h10P->pixmap_width) * 8; *bits_per_itemP = 16; -@@ -634,6 +638,7 @@ processX11Header(X11WDFileHeader * cons +@@ -634,6 +638,7 @@ processX11Header(X11WDFileHeader * const h11P, *colsP = h11FixedP->pixmap_width; *rowsP = h11FixedP->pixmap_height; @@ -198,9 +208,10 @@ diff -up netpbm-10.58.01/converter/other/xwdtopnm.c.security-code netpbm-10.58.0 *padrightP = h11FixedP->bytes_per_line * 8 - h11FixedP->pixmap_width * h11FixedP->bits_per_pixel; -diff -up netpbm-10.58.01/converter/pbm/mdatopbm.c.security-code netpbm-10.58.01/converter/pbm/mdatopbm.c ---- netpbm-10.58.01/converter/pbm/mdatopbm.c.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/converter/pbm/mdatopbm.c 2012-04-09 15:40:03.192619927 +0200 +diff --git a/converter/pbm/mdatopbm.c b/converter/pbm/mdatopbm.c +index d8e0657..12c7468 100644 +--- a/converter/pbm/mdatopbm.c ++++ b/converter/pbm/mdatopbm.c @@ -245,10 +245,13 @@ main(int argc, char **argv) { pm_readlittleshort(infile, &yy); nInCols = yy; } @@ -216,9 +227,10 @@ diff -up netpbm-10.58.01/converter/pbm/mdatopbm.c.security-code netpbm-10.58.01/ data = pbm_allocarray(nOutCols, nOutRows); -diff -up netpbm-10.58.01/converter/pbm/mgrtopbm.c.security-code netpbm-10.58.01/converter/pbm/mgrtopbm.c ---- netpbm-10.58.01/converter/pbm/mgrtopbm.c.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/converter/pbm/mgrtopbm.c 2012-04-09 15:40:03.193619915 +0200 +diff --git a/converter/pbm/mgrtopbm.c b/converter/pbm/mgrtopbm.c +index 9f7004a..60e8477 100644 +--- a/converter/pbm/mgrtopbm.c ++++ b/converter/pbm/mgrtopbm.c @@ -65,6 +65,8 @@ readMgrHeader(FILE * const ifP, if (head.h_high < ' ' || head.l_high < ' ') pm_error("Invalid width field in MGR header"); @@ -228,155 +240,10 @@ diff -up netpbm-10.58.01/converter/pbm/mgrtopbm.c.security-code netpbm-10.58.01/ *colsP = (((int)head.h_wide - ' ') << 6) + ((int)head.l_wide - ' '); *rowsP = (((int)head.h_high - ' ') << 6) + ((int) head.l_high - ' '); *padrightP = ( ( *colsP + pad - 1 ) / pad ) * pad - *colsP; -diff -up netpbm-10.58.01/converter/pbm/pbmtogem.c.security-code netpbm-10.58.01/converter/pbm/pbmtogem.c ---- netpbm-10.58.01/converter/pbm/pbmtogem.c.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/converter/pbm/pbmtogem.c 2012-04-09 15:40:03.193619915 +0200 -@@ -79,6 +79,7 @@ putinit (int const rows, int const cols) - bitsperitem = 0; - bitshift = 7; - outcol = 0; -+ overflow_add(cols, 7); - outmax = (cols + 7) / 8; - outrow = (unsigned char *) pm_allocrow (outmax, sizeof (unsigned char)); - lastrow = (unsigned char *) pm_allocrow (outmax, sizeof (unsigned char)); -diff -up netpbm-10.58.01/converter/pbm/pbmtogo.c.security-code netpbm-10.58.01/converter/pbm/pbmtogo.c ---- netpbm-10.58.01/converter/pbm/pbmtogo.c.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/converter/pbm/pbmtogo.c 2012-04-09 15:40:03.193619915 +0200 -@@ -158,6 +158,7 @@ main(int argc, - bitrow = pbm_allocrow(cols); - - /* Round cols up to the nearest multiple of 8. */ -+ overflow_add(cols, 7); - rucols = ( cols + 7 ) / 8; - bytesperrow = rucols; /* GraphOn uses bytes */ - rucols = rucols * 8; -diff -up netpbm-10.58.01/converter/pbm/pbmtolj.c.security-code netpbm-10.58.01/converter/pbm/pbmtolj.c ---- netpbm-10.58.01/converter/pbm/pbmtolj.c.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/converter/pbm/pbmtolj.c 2012-04-09 15:40:03.194619902 +0200 -@@ -120,7 +120,11 @@ parseCommandLine(int argc, char ** argv, - static void - allocateBuffers(unsigned int const cols) { - -+ overflow_add(cols, 8); - rowBufferSize = (cols + 7) / 8; -+ overflow_add(rowBufferSize, 128); -+ overflow_add(rowBufferSize, rowBufferSize+128); -+ overflow_add(rowBufferSize+10, rowBufferSize/8); - packBufferSize = rowBufferSize + (rowBufferSize + 127) / 128 + 1; - deltaBufferSize = rowBufferSize + rowBufferSize / 8 + 10; - -diff -up netpbm-10.58.01/converter/pbm/pbmtomacp.c.security-code netpbm-10.58.01/converter/pbm/pbmtomacp.c ---- netpbm-10.58.01/converter/pbm/pbmtomacp.c.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/converter/pbm/pbmtomacp.c 2012-04-09 15:40:03.195619889 +0200 -@@ -101,6 +101,7 @@ char *argv[]; - if( !lflg ) - left = 0; - -+ overflow_add(left, MAX_COLS - 1); - if( rflg ) - { if( right - left >= MAX_COLS ) - right = left + MAX_COLS - 1; -@@ -111,6 +112,8 @@ char *argv[]; - if( !tflg ) - top = 0; - -+ overflow_add(top, MAX_LINES - 1); -+ - if( bflg ) - { if( bottom - top >= MAX_LINES ) - bottom = top + MAX_LINES - 1; -diff -up netpbm-10.58.01/converter/pbm/pbmtomda.c.security-code netpbm-10.58.01/converter/pbm/pbmtomda.c ---- netpbm-10.58.01/converter/pbm/pbmtomda.c.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/converter/pbm/pbmtomda.c 2012-04-09 15:40:03.195619889 +0200 -@@ -179,6 +179,7 @@ int main(int argc, char **argv) - - nOutRowsUnrounded = bScale ? nInRows/2 : nInRows; - -+ overflow_add(nOutRowsUnrounded, 3); - nOutRows = ((nOutRowsUnrounded + 3) / 4) * 4; - /* MDA wants rows a multiple of 4 */ - nOutCols = nInCols / 8; -diff -up netpbm-10.58.01/converter/pbm/pbmtoppa/pbm.c.security-code netpbm-10.58.01/converter/pbm/pbmtoppa/pbm.c ---- netpbm-10.58.01/converter/pbm/pbmtoppa/pbm.c.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/converter/pbm/pbmtoppa/pbm.c 2012-04-09 15:40:03.195619889 +0200 -@@ -105,6 +105,7 @@ int pbm_readline(pbm_stat* pbm,unsigned - return 0; - - case P4: -+ overflow_add(pbm->width, 7); - tmp=(pbm->width+7)/8; - tmp2=fread(data,1,tmp,pbm->fptr); - if(tmp2 == tmp) -@@ -129,7 +130,8 @@ void pbm_unreadline (pbm_stat *pbm, void - return; - - pbm->unread = 1; -- pbm->revdata = malloc ((pbm->width+7)/8); -+ overflow_add(pbm->width, 7); -+ pbm->revdata = malloc((pbm->width+7)/8); - memcpy (pbm->revdata, data, (pbm->width+7)/8); - pbm->current_line--; - } -diff -up netpbm-10.58.01/converter/pbm/pbmtoppa/pbmtoppa.c.security-code netpbm-10.58.01/converter/pbm/pbmtoppa/pbmtoppa.c ---- netpbm-10.58.01/converter/pbm/pbmtoppa/pbmtoppa.c.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/converter/pbm/pbmtoppa/pbmtoppa.c 2012-04-09 15:40:03.196619876 +0200 -@@ -441,6 +441,7 @@ main(int argc, char *argv[]) { - pm_error("main(): unrecognized parameter '%s'", argv[argn]); - } - -+ overflow_add(Width, 7); - Pwidth=(Width+7)/8; - printer.fptr=out; - -diff -up netpbm-10.58.01/converter/pbm/pbmtoxbm.c.security-code netpbm-10.58.01/converter/pbm/pbmtoxbm.c ---- netpbm-10.58.01/converter/pbm/pbmtoxbm.c.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/converter/pbm/pbmtoxbm.c 2012-04-09 15:40:03.196619876 +0200 -@@ -335,6 +335,8 @@ convertRaster(FILE * const ifP, - - unsigned char * bitrow; - unsigned int row; -+ -+ overflow_add(cols, padright); - - putinit(xbmVersion); - -diff -up netpbm-10.58.01/converter/pbm/pbmtoybm.c.security-code netpbm-10.58.01/converter/pbm/pbmtoybm.c ---- netpbm-10.58.01/converter/pbm/pbmtoybm.c.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/converter/pbm/pbmtoybm.c 2012-04-09 15:40:03.197619863 +0200 -@@ -113,6 +113,7 @@ main(int argc, const char *argv[]) { - bitrow = pbm_allocrow(cols); - - /* Compute padding to round cols up to the nearest multiple of 16. */ -+ overflow_add(cols, 16); - padright = ((cols + 15) / 16) * 16 - cols; - - putinit(cols, rows); -diff -up netpbm-10.58.01/converter/pbm/pbmtozinc.c.security-code netpbm-10.58.01/converter/pbm/pbmtozinc.c ---- netpbm-10.58.01/converter/pbm/pbmtozinc.c.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/converter/pbm/pbmtozinc.c 2012-04-09 15:40:03.197619863 +0200 -@@ -65,6 +65,7 @@ main(int argc, char * argv[]) { - bitrow = pbm_allocrow( cols ); - - /* Compute padding to round cols up to the nearest multiple of 16. */ -+ overflow_add(cols, 16); - padright = ( ( cols + 15 ) / 16 ) * 16 - cols; - - printf( "USHORT %s[] = {\n",name); -diff -up netpbm-10.58.01/converter/pbm/pbmto10x.c.security-code netpbm-10.58.01/converter/pbm/pbmto10x.c ---- netpbm-10.58.01/converter/pbm/pbmto10x.c.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/converter/pbm/pbmto10x.c 2012-04-09 15:40:03.197619863 +0200 -@@ -162,7 +162,7 @@ main(int argc, char * argv[]) { - res_60x72(); - - pm_close(ifp); -- exit(0); -+ return 0; - } - - -diff -up netpbm-10.58.01/converter/pbm/pbmto4425.c.security-code netpbm-10.58.01/converter/pbm/pbmto4425.c ---- netpbm-10.58.01/converter/pbm/pbmto4425.c.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/converter/pbm/pbmto4425.c 2012-04-09 15:40:03.198619851 +0200 +diff --git a/converter/pbm/pbmto4425.c b/converter/pbm/pbmto4425.c +index 1d97ac6..c4c8cbb 100644 +--- a/converter/pbm/pbmto4425.c ++++ b/converter/pbm/pbmto4425.c @@ -2,6 +2,7 @@ #include "nstring.h" @@ -394,10 +261,108 @@ diff -up netpbm-10.58.01/converter/pbm/pbmto4425.c.security-code netpbm-10.58.01 if(vmap == NULL) { pm_error( "Cannot allocate memory" ); -diff -up netpbm-10.58.01/converter/pbm/pktopbm.c.security-code netpbm-10.58.01/converter/pbm/pktopbm.c ---- netpbm-10.58.01/converter/pbm/pktopbm.c.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/converter/pbm/pktopbm.c 2012-04-09 15:40:03.198619851 +0200 -@@ -277,6 +277,7 @@ main(int argc, char *argv[]) { +diff --git a/converter/pbm/pbmtogem.c b/converter/pbm/pbmtogem.c +index 9eab041..13b0257 100644 +--- a/converter/pbm/pbmtogem.c ++++ b/converter/pbm/pbmtogem.c +@@ -79,6 +79,7 @@ putinit (int const rows, int const cols) + bitsperitem = 0; + bitshift = 7; + outcol = 0; ++ overflow_add(cols, 7); + outmax = (cols + 7) / 8; + outrow = (unsigned char *) pm_allocrow (outmax, sizeof (unsigned char)); + lastrow = (unsigned char *) pm_allocrow (outmax, sizeof (unsigned char)); +diff --git a/converter/pbm/pbmtogo.c b/converter/pbm/pbmtogo.c +index 23b2ee9..d2ee91f 100644 +--- a/converter/pbm/pbmtogo.c ++++ b/converter/pbm/pbmtogo.c +@@ -158,6 +158,7 @@ main(int argc, + bitrow = pbm_allocrow(cols); + + /* Round cols up to the nearest multiple of 8. */ ++ overflow_add(cols, 7); + rucols = ( cols + 7 ) / 8; + bytesperrow = rucols; /* GraphOn uses bytes */ + rucols = rucols * 8; +diff --git a/converter/pbm/pbmtolj.c b/converter/pbm/pbmtolj.c +index 0cceb4f..fdab6df 100644 +--- a/converter/pbm/pbmtolj.c ++++ b/converter/pbm/pbmtolj.c +@@ -120,7 +120,11 @@ parseCommandLine(int argc, char ** argv, + static void + allocateBuffers(unsigned int const cols) { + ++ overflow_add(cols, 8); + rowBufferSize = (cols + 7) / 8; ++ overflow_add(rowBufferSize, 128); ++ overflow_add(rowBufferSize, rowBufferSize+128); ++ overflow_add(rowBufferSize+10, rowBufferSize/8); + packBufferSize = rowBufferSize + (rowBufferSize + 127) / 128 + 1; + deltaBufferSize = rowBufferSize + rowBufferSize / 8 + 10; + +diff --git a/converter/pbm/pbmtomda.c b/converter/pbm/pbmtomda.c +index 3ad5149..9efe5cf 100644 +--- a/converter/pbm/pbmtomda.c ++++ b/converter/pbm/pbmtomda.c +@@ -179,6 +179,7 @@ int main(int argc, char **argv) + + nOutRowsUnrounded = bScale ? nInRows/2 : nInRows; + ++ overflow_add(nOutRowsUnrounded, 3); + nOutRows = ((nOutRowsUnrounded + 3) / 4) * 4; + /* MDA wants rows a multiple of 4 */ + nOutCols = nInCols / 8; +diff --git a/converter/pbm/pbmtoppa/pbm.c b/converter/pbm/pbmtoppa/pbm.c +index 2f8a42b..1c8d236 100644 +--- a/converter/pbm/pbmtoppa/pbm.c ++++ b/converter/pbm/pbmtoppa/pbm.c +@@ -106,6 +106,7 @@ int pbm_readline(pbm_stat* pbm,unsigned char* data) + return 0; + + case P4: ++ overflow_add(pbm->width, 7); + tmp=(pbm->width+7)/8; + tmp2=fread(data,1,tmp,pbm->fptr); + if(tmp2 == tmp) +@@ -130,6 +131,7 @@ void pbm_unreadline (pbm_stat *pbm, void *data) + return; + + pbm->unread = 1; ++ overflow_add(pbm->width, 7); + pbm->revdata = malloc ((pbm->width+7)/8); + memcpy (pbm->revdata, data, (pbm->width+7)/8); + pbm->current_line--; +diff --git a/converter/pbm/pbmtoppa/pbmtoppa.c b/converter/pbm/pbmtoppa/pbmtoppa.c +index f43c08a..98e0284 100644 +--- a/converter/pbm/pbmtoppa/pbmtoppa.c ++++ b/converter/pbm/pbmtoppa/pbmtoppa.c +@@ -452,6 +452,7 @@ main(int argc, char *argv[]) { + pm_error("main(): unrecognized parameter '%s'", argv[argn]); + } + ++ overflow_add(Width, 7); + Pwidth=(Width+7)/8; + printer.fptr=out; + +diff --git a/converter/pbm/pbmtoxbm.c b/converter/pbm/pbmtoxbm.c +index 14c6b85..362b70e 100644 +--- a/converter/pbm/pbmtoxbm.c ++++ b/converter/pbm/pbmtoxbm.c +@@ -351,6 +351,8 @@ convertRaster(FILE * const ifP, + + unsigned char * bitrow; + unsigned int row; ++ ++ overflow_add(cols, padright); + + putinit(xbmVersion); + +diff --git a/converter/pbm/pktopbm.c b/converter/pbm/pktopbm.c +index 712f339..b6fcb02 100644 +--- a/converter/pbm/pktopbm.c ++++ b/converter/pbm/pktopbm.c +@@ -280,6 +280,7 @@ main(int argc, char *argv[]) { if (flagbyte == 7) { /* long form preamble */ integer packetlength = get32() ; /* character packet length */ car = get32() ; /* character number */ @@ -405,15 +370,17 @@ diff -up netpbm-10.58.01/converter/pbm/pktopbm.c.security-code netpbm-10.58.01/c endofpacket = packetlength + pktopbm_pkloc; /* calculate end of packet */ if ((car >= MAXPKCHAR) || !filename[car]) { -diff -up netpbm-10.58.01/converter/pbm/thinkjettopbm.l.security-code netpbm-10.58.01/converter/pbm/thinkjettopbm.l ---- netpbm-10.58.01/converter/pbm/thinkjettopbm.l.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/converter/pbm/thinkjettopbm.l 2012-04-09 15:40:03.199619839 +0200 +diff --git a/converter/pbm/thinkjettopbm.l b/converter/pbm/thinkjettopbm.l +index 5de4f2b..7f31de5 100644 +--- a/converter/pbm/thinkjettopbm.l ++++ b/converter/pbm/thinkjettopbm.l @@ -114,7 +114,9 @@ DIG [0-9] \033\*b{DIG}+W { int l; if (rowCount >= rowCapacity) { +- rowCapacity += 100; + overflow_add(rowCapacity, 100); - rowCapacity += 100; ++ rowCapacity += 100; + overflow2(rowCapacity, sizeof *rows); rows = realloc (rows, rowCapacity * sizeof *rows); if (rows == NULL) @@ -427,20 +394,22 @@ diff -up netpbm-10.58.01/converter/pbm/thinkjettopbm.l.security-code netpbm-10.5 pbm_writepbminit(stdout, maxRowLength*8, rowCount, 0); packed_bitrow = malloc(maxRowLength); -diff -up netpbm-10.58.01/converter/pbm/ybmtopbm.c.security-code netpbm-10.58.01/converter/pbm/ybmtopbm.c ---- netpbm-10.58.01/converter/pbm/ybmtopbm.c.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/converter/pbm/ybmtopbm.c 2012-04-09 15:40:03.199619839 +0200 -@@ -49,6 +49,7 @@ getinit(FILE * const ifP, +diff --git a/converter/pbm/ybmtopbm.c b/converter/pbm/ybmtopbm.c +index 2a42908..cf1ff03 100644 +--- a/converter/pbm/ybmtopbm.c ++++ b/converter/pbm/ybmtopbm.c +@@ -43,6 +43,7 @@ getinit(FILE * const ifP, pm_error("EOF / read error"); *depthP = 1; + overflow_add(*colsP, 15); - *padrightP = ((*colsP + 15) / 16) * 16 - *colsP; } -diff -up netpbm-10.58.01/converter/pgm/lispmtopgm.c.security-code netpbm-10.58.01/converter/pgm/lispmtopgm.c ---- netpbm-10.58.01/converter/pgm/lispmtopgm.c.security-code 2012-04-09 15:31:42.000000000 +0200 -+++ netpbm-10.58.01/converter/pgm/lispmtopgm.c 2012-04-09 15:40:03.199619839 +0200 + +diff --git a/converter/pgm/lispmtopgm.c b/converter/pgm/lispmtopgm.c +index 40dd3fb..b5469f7 100644 +--- a/converter/pgm/lispmtopgm.c ++++ b/converter/pgm/lispmtopgm.c @@ -58,6 +58,7 @@ main( argc, argv ) pm_error( "depth (%d bits) is too large", depth); @@ -449,20 +418,19 @@ diff -up netpbm-10.58.01/converter/pgm/lispmtopgm.c.security-code netpbm-10.58.0 grayrow = pgm_allocrow( ( cols + 7 ) / 8 * 8 ); for ( row = 0; row < rows; ++row ) -@@ -102,7 +103,9 @@ getinit( file, colsP, rowsP, depthP, pad +@@ -102,6 +103,8 @@ getinit( file, colsP, rowsP, depthP, padrightP ) if ( *depthP == 0 ) *depthP = 1; /* very old file */ -- + + overflow_add((int)colsP, 31); -+ + *padrightP = ( ( *colsP + 31 ) / 32 ) * 32 - *colsP; - if ( *colsP != (cols_32 - *padrightP) ) { -diff -up netpbm-10.58.01/converter/pgm/psidtopgm.c.security-code netpbm-10.58.01/converter/pgm/psidtopgm.c ---- netpbm-10.58.01/converter/pgm/psidtopgm.c.security-code 2012-04-09 15:31:42.000000000 +0200 -+++ netpbm-10.58.01/converter/pgm/psidtopgm.c 2012-04-09 15:40:03.200619827 +0200 +diff --git a/converter/pgm/psidtopgm.c b/converter/pgm/psidtopgm.c +index 07417d1..25bb311 100644 +--- a/converter/pgm/psidtopgm.c ++++ b/converter/pgm/psidtopgm.c @@ -78,6 +78,7 @@ main(int argc, pm_error("bits/sample (%d) is too large.", bitspersample); @@ -471,10 +439,24 @@ diff -up netpbm-10.58.01/converter/pgm/psidtopgm.c.security-code netpbm-10.58.01 grayrow = pgm_allocrow((cols + 7) / 8 * 8); for (row = 0; row < rows; ++row) { unsigned int col; -diff -up netpbm-10.58.01/converter/ppm/ilbmtoppm.c.security-code netpbm-10.58.01/converter/ppm/ilbmtoppm.c ---- netpbm-10.58.01/converter/ppm/ilbmtoppm.c.security-code 2012-04-09 15:31:44.000000000 +0200 -+++ netpbm-10.58.01/converter/ppm/ilbmtoppm.c 2012-04-09 15:40:03.201619815 +0200 -@@ -592,6 +592,7 @@ decode_row(FILE * const ifP, +diff --git a/converter/ppm/Makefile b/converter/ppm/Makefile +index 09f05cd..f68170f 100644 +--- a/converter/ppm/Makefile ++++ b/converter/ppm/Makefile +@@ -11,7 +11,7 @@ SUBDIRS = hpcdtoppm + + PORTBINARIES = 411toppm eyuvtoppm gouldtoppm ilbmtoppm imgtoppm \ + leaftoppm mtvtoppm neotoppm \ +- pcxtoppm pc1toppm pi1toppm picttoppm pjtoppm \ ++ pcxtoppm pc1toppm pi1toppm pjtoppm \ + ppmtoacad ppmtoapplevol ppmtoarbtxt ppmtoascii \ + ppmtobmp ppmtoeyuv ppmtogif ppmtoicr ppmtoilbm \ + ppmtoleaf ppmtolj ppmtomitsu ppmtoneo \ +diff --git a/converter/ppm/ilbmtoppm.c b/converter/ppm/ilbmtoppm.c +index 662be0b..2a86efc 100644 +--- a/converter/ppm/ilbmtoppm.c ++++ b/converter/ppm/ilbmtoppm.c +@@ -606,6 +606,7 @@ decode_row(FILE * const ifP, rawtype *chp; cols = bmhdP->w; @@ -482,7 +464,7 @@ diff -up netpbm-10.58.01/converter/ppm/ilbmtoppm.c.security-code netpbm-10.58.01 bytes = RowBytes(cols); for( plane = 0; plane < nPlanes; plane++ ) { int mask; -@@ -679,6 +680,23 @@ decode_mask(FILE * const ifP, +@@ -693,6 +694,23 @@ decode_mask(FILE * const ifP, Multipalette handling ****************************************************************************/ @@ -506,7 +488,7 @@ diff -up netpbm-10.58.01/converter/ppm/ilbmtoppm.c.security-code netpbm-10.58.01 static void multi_adjust(cmap, row, palchange) -@@ -1341,6 +1359,9 @@ dcol_to_ppm(FILE * const ifP, +@@ -1355,6 +1373,9 @@ dcol_to_ppm(FILE * const ifP, if( redmaxval != maxval || greenmaxval != maxval || bluemaxval != maxval ) pm_message("scaling colors to %d bits", pm_maxvaltobits(maxval)); @@ -516,7 +498,7 @@ diff -up netpbm-10.58.01/converter/ppm/ilbmtoppm.c.security-code netpbm-10.58.01 MALLOCARRAY_NOFAIL(redtable, redmaxval +1); MALLOCARRAY_NOFAIL(greentable, greenmaxval +1); MALLOCARRAY_NOFAIL(bluetable, bluemaxval +1); -@@ -1763,7 +1784,9 @@ PCHG_ConvertSmall(PCHG, cmap, mask, data +@@ -1784,7 +1805,9 @@ PCHG_ConvertSmall(PCHG, cmap, mask, datasize) ChangeCount32 = *data++; datasize -= 2; @@ -526,7 +508,7 @@ diff -up netpbm-10.58.01/converter/ppm/ilbmtoppm.c.security-code netpbm-10.58.01 for( i = 0; i < changes; i++ ) { if( totalchanges >= PCHG->TotalChanges ) goto fail; if( datasize < 2 ) goto fail; -@@ -2028,6 +2051,9 @@ read_pchg(FILE * const ifp, +@@ -2049,6 +2072,9 @@ read_pchg(FILE * const ifP, cmap->mp_change[i] = NULL; if( PCHG.StartLine < 0 ) { int nch; @@ -536,17 +518,18 @@ diff -up netpbm-10.58.01/converter/ppm/ilbmtoppm.c.security-code netpbm-10.58.01 nch = PCHG.MaxReg - PCHG.MinReg +1; MALLOCARRAY_NOFAIL(cmap->mp_init, nch + 1); for( i = 0; i < nch; i++ ) -@@ -2104,6 +2130,7 @@ process_body( FILE * const ifp, - if( typeid == ID_ILBM ) { +@@ -2125,6 +2151,7 @@ process_body( FILE * const ifP, + if (typeid == ID_ILBM) { int isdeep; + overflow_add(bmhdP->w, 15); MALLOCARRAY_NOFAIL(ilbmrow, RowBytes(bmhdP->w)); *viewportmodesP |= fakeviewport; /* -isham/-isehb */ -diff -up netpbm-10.58.01/converter/ppm/imgtoppm.c.security-code netpbm-10.58.01/converter/ppm/imgtoppm.c ---- netpbm-10.58.01/converter/ppm/imgtoppm.c.security-code 2012-04-09 15:31:44.000000000 +0200 -+++ netpbm-10.58.01/converter/ppm/imgtoppm.c 2012-04-09 15:40:03.202619802 +0200 +diff --git a/converter/ppm/imgtoppm.c b/converter/ppm/imgtoppm.c +index 7078b88..eb8509e 100644 +--- a/converter/ppm/imgtoppm.c ++++ b/converter/ppm/imgtoppm.c @@ -84,6 +84,7 @@ main(int argc, char ** argv) { len = atoi((char*) buf ); if ( fread( buf, len, 1, ifp ) != 1 ) @@ -563,22 +546,11 @@ diff -up netpbm-10.58.01/converter/ppm/imgtoppm.c.security-code netpbm-10.58.01/ if ( len != cols * rows ) pm_message( "pixel data length (%d) does not match image size (%d)", -diff -up netpbm-10.58.01/converter/ppm/Makefile.security-code netpbm-10.58.01/converter/ppm/Makefile ---- netpbm-10.58.01/converter/ppm/Makefile.security-code 2012-04-09 15:31:44.000000000 +0200 -+++ netpbm-10.58.01/converter/ppm/Makefile 2012-04-09 15:40:03.202619802 +0200 -@@ -11,7 +11,7 @@ SUBDIRS = hpcdtoppm ppmtompeg - - PORTBINARIES = 411toppm eyuvtoppm gouldtoppm ilbmtoppm imgtoppm \ - leaftoppm mtvtoppm neotoppm \ -- pcxtoppm pc1toppm pi1toppm picttoppm pjtoppm \ -+ pcxtoppm pc1toppm pi1toppm pjtoppm \ - ppmtoacad ppmtoapplevol ppmtoarbtxt ppmtoascii \ - ppmtobmp ppmtoeyuv ppmtogif ppmtoicr ppmtoilbm \ - ppmtoleaf ppmtolj ppmtomitsu ppmtoneo \ -diff -up netpbm-10.58.01/converter/ppm/pcxtoppm.c.security-code netpbm-10.58.01/converter/ppm/pcxtoppm.c ---- netpbm-10.58.01/converter/ppm/pcxtoppm.c.security-code 2012-04-09 15:31:44.000000000 +0200 -+++ netpbm-10.58.01/converter/ppm/pcxtoppm.c 2012-04-09 15:40:03.203619789 +0200 -@@ -409,6 +409,7 @@ pcx_planes_to_pixels(pixels, bitplanes, +diff --git a/converter/ppm/pcxtoppm.c b/converter/ppm/pcxtoppm.c +index e252ba2..270ae3b 100644 +--- a/converter/ppm/pcxtoppm.c ++++ b/converter/ppm/pcxtoppm.c +@@ -409,6 +409,7 @@ pcx_planes_to_pixels(pixels, bitplanes, bytesperline, planes, bitsperpixel) /* * clear the pixel buffer */ @@ -594,19 +566,20 @@ diff -up netpbm-10.58.01/converter/ppm/pcxtoppm.c.security-code netpbm-10.58.01/ rawcols = BytesPerLine * 8 / BitsPerPixel; if (headerCols > rawcols) { pm_message("warning - BytesPerLine = %d, " -diff -up netpbm-10.58.01/converter/ppm/picttoppm.c.security-code netpbm-10.58.01/converter/ppm/picttoppm.c ---- netpbm-10.58.01/converter/ppm/picttoppm.c.security-code 2012-04-09 15:31:44.000000000 +0200 -+++ netpbm-10.58.01/converter/ppm/picttoppm.c 2012-04-09 15:40:03.205619763 +0200 -@@ -1,3 +1,5 @@ +diff --git a/converter/ppm/picttoppm.c b/converter/ppm/picttoppm.c +index 828d527..8cdb7b3 100644 +--- a/converter/ppm/picttoppm.c ++++ b/converter/ppm/picttoppm.c +@@ -1,3 +1,4 @@ +#error "Unfixable. Don't ship me" -+ /* * picttoppm.c -- convert a MacIntosh PICT file to PPM format. * -diff -up netpbm-10.58.01/converter/ppm/pjtoppm.c.security-code netpbm-10.58.01/converter/ppm/pjtoppm.c ---- netpbm-10.58.01/converter/ppm/pjtoppm.c.security-code 2012-04-09 15:31:44.000000000 +0200 -+++ netpbm-10.58.01/converter/ppm/pjtoppm.c 2012-04-09 15:40:03.206619751 +0200 -@@ -127,19 +127,21 @@ main(argc, argv) +diff --git a/converter/ppm/pjtoppm.c b/converter/ppm/pjtoppm.c +index 7b694fb..62ce77e 100644 +--- a/converter/ppm/pjtoppm.c ++++ b/converter/ppm/pjtoppm.c +@@ -127,20 +127,22 @@ main(argc, argv) case 'V': /* send plane */ case 'W': /* send last plane */ if (rows == -1 || r >= rows || image == NULL) { @@ -615,6 +588,7 @@ diff -up netpbm-10.58.01/converter/ppm/pjtoppm.c.security-code netpbm-10.58.01/c + overflow_add(rows, 100); rows += 100; + } ++ if (image == NULL) { - MALLOCARRAY(image, rows * planes); - MALLOCARRAY(imlen, rows * planes); @@ -623,18 +597,21 @@ diff -up netpbm-10.58.01/converter/ppm/pjtoppm.c.security-code netpbm-10.58.01/c + imlen = (int *) malloc3(rows , planes, sizeof(int)); } else { -+ overflow2(rows,planes); - image = (unsigned char **) +- image = (unsigned char **) - realloc(image, - rows * planes * -+ realloc2(image, rows * planes, - sizeof(unsigned char *)); +- sizeof(unsigned char *)); - imlen = (int *) - realloc(imlen, rows * planes * sizeof(int)); -+ imlen = (int *) realloc2(imlen, rows * planes, sizeof(int)); - } +- } ++ overflow2(rows,planes); ++ image = (unsigned char **) ++ realloc2(image, rows * planes, ++ sizeof(unsigned char *)); ++ imlen = (int *) realloc2(imlen, rows * planes, sizeof(int)); } } if (image == NULL || imlen == NULL) + pm_error("out of memory"); @@ -212,8 +214,10 @@ main(argc, argv) for (i = 0, c = 0; c < imlen[p + r * planes]; c += 2) for (cmd = image[p + r * planes][c], @@ -655,10 +632,11 @@ diff -up netpbm-10.58.01/converter/ppm/pjtoppm.c.security-code netpbm-10.58.01/c cols *= 8; } -diff -up netpbm-10.58.01/converter/ppm/ppmtoeyuv.c.security-code netpbm-10.58.01/converter/ppm/ppmtoeyuv.c ---- netpbm-10.58.01/converter/ppm/ppmtoeyuv.c.security-code 2012-04-09 15:31:42.000000000 +0200 -+++ netpbm-10.58.01/converter/ppm/ppmtoeyuv.c 2012-04-09 15:40:03.206619751 +0200 -@@ -114,6 +114,7 @@ create_multiplication_tables(const pixva +diff --git a/converter/ppm/ppmtoeyuv.c b/converter/ppm/ppmtoeyuv.c +index f5ce115..6f072be 100644 +--- a/converter/ppm/ppmtoeyuv.c ++++ b/converter/ppm/ppmtoeyuv.c +@@ -114,6 +114,7 @@ create_multiplication_tables(const pixval maxval) { int index; @@ -666,34 +644,22 @@ diff -up netpbm-10.58.01/converter/ppm/ppmtoeyuv.c.security-code netpbm-10.58.01 MALLOCARRAY_NOFAIL(mult299 , maxval+1); MALLOCARRAY_NOFAIL(mult587 , maxval+1); MALLOCARRAY_NOFAIL(mult114 , maxval+1); -diff -up netpbm-10.58.01/converter/ppm/ppmtoicr.c.security-code netpbm-10.58.01/converter/ppm/ppmtoicr.c ---- netpbm-10.58.01/converter/ppm/ppmtoicr.c.security-code 2012-04-09 15:31:44.000000000 +0200 -+++ netpbm-10.58.01/converter/ppm/ppmtoicr.c 2012-04-09 15:40:03.207619739 +0200 -@@ -169,7 +169,7 @@ char* argv[]; - - if (rleflag) { - pm_message("sending run-length encoded picture data ..." ); -- testimage = (char*) malloc(rows*cols); -+ testimage = (char*) malloc2(rows, cols); - p = testimage; - for (i=0; i PCL_MAXVAL) pm_error("color range too large; reduce with ppmcscale"); + + if (cols < 0 || rows < 0) + pm_error("negative size is not possible"); - ++ /* Figure out the colormap. */ pm_message("Computing colormap..."); -@@ -296,6 +298,8 @@ main(int argc, const char * argv[]) { + chv = ppm_computecolorhist(pixels, cols, rows, MAXCOLORS, &colors); +@@ -325,6 +328,8 @@ main(int argc, const char * argv[]) { case 0: /* direct mode (no palette) */ bpp = bitsperpixel(maxval); /* bits per pixel */ bpg = bpp; bpb = bpp; -+ overflow2(bpp, 3); -+ overflow_add(bpp*3, 7); ++ overflow2(bpp, 3); ++ overflow_add(bpp*3, 7); bpp = (bpp*3+7)>>3; /* bytes per pixel now */ bpr = (bpp<<3)-bpg-bpb; bpp *= cols; /* bytes per row now */ -@@ -305,9 +309,13 @@ main(int argc, const char * argv[]) { +@@ -334,9 +339,13 @@ main(int argc, const char * argv[]) { case 3: case 7: pclindex++; default: bpp = 8/pclindex; -+ overflow_add(cols, bpp); -+ if(bpp == 0) -+ pm_error("assert: no bpp"); ++ overflow_add(cols, bpp); ++ if(bpp == 0) ++ pm_error("assert: no bpp"); bpp = (cols+bpp-1)/bpp; /* bytes per row */ } } @@ -773,9 +744,10 @@ diff -up netpbm-10.58.01/converter/ppm/ppmtopjxl.c.security-code netpbm-10.58.01 inrow = (char *)malloc((unsigned)bpp); outrow = (char *)malloc((unsigned)bpp*2); runcnt = (signed char *)malloc((unsigned)bpp); -diff -up netpbm-10.58.01/converter/ppm/ppmtowinicon.c.security-code netpbm-10.58.01/converter/ppm/ppmtowinicon.c ---- netpbm-10.58.01/converter/ppm/ppmtowinicon.c.security-code 2012-04-09 15:31:44.000000000 +0200 -+++ netpbm-10.58.01/converter/ppm/ppmtowinicon.c 2012-04-09 15:40:03.213619664 +0200 +diff --git a/converter/ppm/ppmtowinicon.c b/converter/ppm/ppmtowinicon.c +index c673798..af2b445 100644 +--- a/converter/ppm/ppmtowinicon.c ++++ b/converter/ppm/ppmtowinicon.c @@ -12,6 +12,7 @@ #include @@ -784,7 +756,7 @@ diff -up netpbm-10.58.01/converter/ppm/ppmtowinicon.c.security-code netpbm-10.58 #include "pm_c_util.h" #include "winico.h" -@@ -219,6 +220,7 @@ createAndBitmap (gray ** const ba, int c +@@ -214,6 +215,7 @@ createAndBitmap (gray ** const ba, int const cols, int const rows, MALLOCARRAY_NOFAIL(rowData, rows); icBitmap->xBytes = xBytes; icBitmap->data = rowData; @@ -792,7 +764,7 @@ diff -up netpbm-10.58.01/converter/ppm/ppmtowinicon.c.security-code netpbm-10.58 icBitmap->size = xBytes * rows; for (y=0;yxBytes = xBytes; icBitmap->data = rowData; @@ -800,7 +772,7 @@ diff -up netpbm-10.58.01/converter/ppm/ppmtowinicon.c.security-code netpbm-10.58 icBitmap->size = xBytes * rows; for (y=0;yxBytes = xBytes; icBitmap->data = rowData; @@ -808,21 +780,24 @@ diff -up netpbm-10.58.01/converter/ppm/ppmtowinicon.c.security-code netpbm-10.58 icBitmap->size = xBytes * rows; for (y=0;ybitcount = bpp; entry->ih = createInfoHeader(entry, xorBitmap, andBitmap); entry->colors = palette->colors; +- entry->size_in_bytes = + overflow2(4, entry->color_count); + overflow_add(xorBitmap->size, andBitmap->size); + overflow_add(xorBitmap->size + andBitmap->size, 40); + overflow_add(xorBitmap->size + andBitmap->size + 40, 4 * entry->color_count); - entry->size_in_bytes = ++ entry->size_in_bytes = xorBitmap->size + andBitmap->size + 40 + (4 * entry->color_count); if (verbose) -diff -up netpbm-10.58.01/converter/ppm/ppmtoxpm.c.security-code netpbm-10.58.01/converter/ppm/ppmtoxpm.c ---- netpbm-10.58.01/converter/ppm/ppmtoxpm.c.security-code 2012-04-09 15:31:44.000000000 +0200 -+++ netpbm-10.58.01/converter/ppm/ppmtoxpm.c 2012-04-09 15:40:03.214619651 +0200 -@@ -197,6 +197,7 @@ genNumstr(unsigned int const input, int + pm_message("entry->size_in_bytes = %d + %d + %d = %d", +diff --git a/converter/ppm/ppmtoxpm.c b/converter/ppm/ppmtoxpm.c +index 38d9997..904c98d 100644 +--- a/converter/ppm/ppmtoxpm.c ++++ b/converter/ppm/ppmtoxpm.c +@@ -197,6 +197,7 @@ genNumstr(unsigned int const input, int const digits) { unsigned int i; /* Allocate memory for printed number. Abort if error. */ @@ -838,9 +813,10 @@ diff -up netpbm-10.58.01/converter/ppm/ppmtoxpm.c.security-code netpbm-10.58.01/ MALLOCARRAY(cmap, cmapSize); if (cmapP == NULL) pm_error("Out of memory allocating %u bytes for a color map.", -diff -up netpbm-10.58.01/converter/ppm/qrttoppm.c.security-code netpbm-10.58.01/converter/ppm/qrttoppm.c ---- netpbm-10.58.01/converter/ppm/qrttoppm.c.security-code 2012-04-09 15:31:42.000000000 +0200 -+++ netpbm-10.58.01/converter/ppm/qrttoppm.c 2012-04-09 15:40:03.215619638 +0200 +diff --git a/converter/ppm/qrttoppm.c b/converter/ppm/qrttoppm.c +index 935463e..653084c 100644 +--- a/converter/ppm/qrttoppm.c ++++ b/converter/ppm/qrttoppm.c @@ -46,7 +46,7 @@ main( argc, argv ) ppm_writeppminit( stdout, cols, rows, maxval, 0 ); @@ -850,26 +826,28 @@ diff -up netpbm-10.58.01/converter/ppm/qrttoppm.c.security-code netpbm-10.58.01/ if ( buf == (unsigned char *) 0 ) pm_error( "out of memory" ); -diff -up netpbm-10.58.01/converter/ppm/sldtoppm.c.security-code netpbm-10.58.01/converter/ppm/sldtoppm.c ---- netpbm-10.58.01/converter/ppm/sldtoppm.c.security-code 2012-04-09 15:31:44.000000000 +0200 -+++ netpbm-10.58.01/converter/ppm/sldtoppm.c 2012-04-09 15:40:03.216619626 +0200 -@@ -455,6 +455,8 @@ slider(slvecfn slvec, +diff --git a/converter/ppm/sldtoppm.c b/converter/ppm/sldtoppm.c +index 6ba4cb4..fc6a498 100644 +--- a/converter/ppm/sldtoppm.c ++++ b/converter/ppm/sldtoppm.c +@@ -464,6 +464,8 @@ slider(slvecfn slvec, /* Allocate image buffer and clear it to black. */ -+ overflow_add(ixdots,1); -+ overflow_add(iydots,1); ++ overflow_add(ixdots, 1); ++ overflow_add(iydots, 1); pixels = ppm_allocarray(pixcols = ixdots + 1, pixrows = iydots + 1); PPM_ASSIGN(rgbcolor, 0, 0, 0); ppmd_filledrectangle(pixels, pixcols, pixrows, pixmaxval, 0, 0, -diff -up netpbm-10.58.01/converter/ppm/ximtoppm.c.security-code netpbm-10.58.01/converter/ppm/ximtoppm.c ---- netpbm-10.58.01/converter/ppm/ximtoppm.c.security-code 2012-04-09 15:31:44.000000000 +0200 -+++ netpbm-10.58.01/converter/ppm/ximtoppm.c 2012-04-09 15:40:03.216619626 +0200 +diff --git a/converter/ppm/ximtoppm.c b/converter/ppm/ximtoppm.c +index ce5e639..a39b689 100644 +--- a/converter/ppm/ximtoppm.c ++++ b/converter/ppm/ximtoppm.c @@ -117,6 +117,7 @@ ReadXimHeader(FILE * const in_fp, header->bits_channel = atoi(a_head.bits_per_channel); header->alpha_flag = atoi(a_head.alpha_channel); if (strlen(a_head.author)) { -+ overflow_add(strlen(a_head.author),1); ++ overflow_add(strlen(a_head.author),1); if (!(header->author = calloc((unsigned int)strlen(a_head.author)+1, 1))) { pm_message("ReadXimHeader: can't calloc author string" ); @@ -893,14 +871,15 @@ diff -up netpbm-10.58.01/converter/ppm/ximtoppm.c.security-code netpbm-10.58.01/ if (header->nchannels == 3 && header->bits_channel == 8) header->ncolors = 0; else if (header->nchannels == 1 && header->bits_channel == 8) { -+ overflow2(header->ncolors, sizeof(Color)); ++ overflow2(header->ncolors, sizeof(Color)); header->colors = (Color *)calloc((unsigned int)header->ncolors, sizeof(Color)); if (header->colors == NULL) { -diff -up netpbm-10.58.01/editor/pamcut.c.security-code netpbm-10.58.01/editor/pamcut.c ---- netpbm-10.58.01/editor/pamcut.c.security-code 2012-04-09 15:31:33.000000000 +0200 -+++ netpbm-10.58.01/editor/pamcut.c 2012-04-09 15:40:03.218619602 +0200 -@@ -655,6 +655,8 @@ cutOneImage(FILE * const ifP +diff --git a/editor/pamcut.c b/editor/pamcut.c +index 7c41af3..72df687 100644 +--- a/editor/pamcut.c ++++ b/editor/pamcut.c +@@ -655,6 +655,8 @@ cutOneImage(FILE * const ifP, outpam = inpam; /* Initial value -- most fields should be same */ outpam.file = ofP; @@ -909,9 +888,10 @@ diff -up netpbm-10.58.01/editor/pamcut.c.security-code netpbm-10.58.01/editor/pa outpam.width = rightcol - leftcol + 1; outpam.height = bottomrow - toprow + 1; -diff -up netpbm-10.58.01/editor/pbmreduce.c.security-code netpbm-10.58.01/editor/pbmreduce.c ---- netpbm-10.58.01/editor/pbmreduce.c.security-code 2012-04-09 15:31:33.000000000 +0200 -+++ netpbm-10.58.01/editor/pbmreduce.c 2012-04-09 15:40:03.219619590 +0200 +diff --git a/editor/pbmreduce.c b/editor/pbmreduce.c +index f49c8d9..580e5e0 100644 +--- a/editor/pbmreduce.c ++++ b/editor/pbmreduce.c @@ -94,6 +94,7 @@ main( argc, argv ) if (halftone == QT_FS) { unsigned int col; @@ -920,10 +900,11 @@ diff -up netpbm-10.58.01/editor/pbmreduce.c.security-code netpbm-10.58.01/editor MALLOCARRAY(thiserr, newcols + 2); MALLOCARRAY(nexterr, newcols + 2); if (thiserr == NULL || nexterr == NULL) -diff -up netpbm-10.58.01/editor/pnmgamma.c.security-code netpbm-10.58.01/editor/pnmgamma.c ---- netpbm-10.58.01/editor/pnmgamma.c.security-code 2012-04-09 15:31:34.000000000 +0200 -+++ netpbm-10.58.01/editor/pnmgamma.c 2012-04-09 15:40:03.220619577 +0200 -@@ -586,6 +586,7 @@ createGammaTables(enum transferFunction +diff --git a/editor/pnmgamma.c b/editor/pnmgamma.c +index b357b0d..ec612d3 100644 +--- a/editor/pnmgamma.c ++++ b/editor/pnmgamma.c +@@ -596,6 +596,7 @@ createGammaTables(enum transferFunction const transferFunction, xelval ** const btableP) { /* Allocate space for the tables. */ @@ -931,10 +912,11 @@ diff -up netpbm-10.58.01/editor/pnmgamma.c.security-code netpbm-10.58.01/editor/ MALLOCARRAY(*rtableP, maxval+1); MALLOCARRAY(*gtableP, maxval+1); MALLOCARRAY(*btableP, maxval+1); -diff -up netpbm-10.58.01/editor/pnmhisteq.c.security-code netpbm-10.58.01/editor/pnmhisteq.c ---- netpbm-10.58.01/editor/pnmhisteq.c.security-code 2012-04-09 15:31:33.000000000 +0200 -+++ netpbm-10.58.01/editor/pnmhisteq.c 2012-04-09 15:40:03.220619577 +0200 -@@ -103,6 +103,7 @@ computeLuminosityHistogram(xel * const * +diff --git a/editor/pnmhisteq.c b/editor/pnmhisteq.c +index 8af4201..0c8d6e5 100644 +--- a/editor/pnmhisteq.c ++++ b/editor/pnmhisteq.c +@@ -107,6 +107,7 @@ computeLuminosityHistogram(xel * const * const xels, unsigned int pixelCount; unsigned int * lumahist; @@ -942,21 +924,22 @@ diff -up netpbm-10.58.01/editor/pnmhisteq.c.security-code netpbm-10.58.01/editor MALLOCARRAY(lumahist, maxval + 1); if (lumahist == NULL) pm_error("Out of storage allocating array for %u histogram elements", -diff -up netpbm-10.58.01/editor/pnmindex.csh.security-code netpbm-10.58.01/editor/pnmindex.csh ---- netpbm-10.58.01/editor/pnmindex.csh.security-code 2012-04-09 15:31:33.000000000 +0200 -+++ netpbm-10.58.01/editor/pnmindex.csh 2012-04-09 15:40:03.221619564 +0200 -@@ -1,5 +1,8 @@ +diff --git a/editor/pnmindex.csh b/editor/pnmindex.csh +index c6f1e84..c513a84 100755 +--- a/editor/pnmindex.csh ++++ b/editor/pnmindex.csh +@@ -1,5 +1,7 @@ #!/bin/csh -f # +echo "Unsafe code, needs debugging, do not ship" +exit 1 -+# # pnmindex - build a visual index of a bunch of anymaps # # Copyright (C) 1991 by Jef Poskanzer. -diff -up netpbm-10.58.01/editor/pnmpad.c.security-code netpbm-10.58.01/editor/pnmpad.c ---- netpbm-10.58.01/editor/pnmpad.c.security-code 2012-04-09 15:31:34.000000000 +0200 -+++ netpbm-10.58.01/editor/pnmpad.c 2012-04-09 15:40:03.221619564 +0200 +diff --git a/editor/pnmpad.c b/editor/pnmpad.c +index 1904b68..0797cf1 100644 +--- a/editor/pnmpad.c ++++ b/editor/pnmpad.c @@ -527,6 +527,8 @@ main(int argc, const char ** argv) { computePadSizes(cmdline, cols, rows, &lpad, &rpad, &tpad, &bpad); @@ -966,19 +949,19 @@ diff -up netpbm-10.58.01/editor/pnmpad.c.security-code netpbm-10.58.01/editor/pn newcols = cols + lpad + rpad; if (PNM_FORMAT_TYPE(format) == PBM_TYPE) -diff -up netpbm-10.58.01/editor/pnmremap.c.security-code netpbm-10.58.01/editor/pnmremap.c ---- netpbm-10.58.01/editor/pnmremap.c.security-code 2012-04-09 15:31:33.000000000 +0200 -+++ netpbm-10.58.01/editor/pnmremap.c 2012-04-09 15:40:03.222619551 +0200 -@@ -409,7 +409,7 @@ initFserr(struct pam * const pamP, - unsigned int plane; +diff --git a/editor/pnmremap.c b/editor/pnmremap.c +index b2448cb..b924120 100644 +--- a/editor/pnmremap.c ++++ b/editor/pnmremap.c +@@ -428,6 +428,7 @@ initFserr(struct pam * const pamP, unsigned int const fserrSize = pamP->width + 2; -- + + overflow_add(pamP->width, 2); fserrP->width = pamP->width; MALLOCARRAY(fserrP->thiserr, pamP->depth); -@@ -445,6 +445,7 @@ floydInitRow(struct pam * const pamP, st +@@ -465,6 +466,7 @@ floydInitRow(struct pam * const pamP, struct fserr * const fserrP) { int col; @@ -986,45 +969,45 @@ diff -up netpbm-10.58.01/editor/pnmremap.c.security-code netpbm-10.58.01/editor/ for (col = 0; col < pamP->width + 2; ++col) { unsigned int plane; for (plane = 0; plane < pamP->depth; ++plane) -diff -up netpbm-10.58.01/editor/pnmscalefixed.c.security-code netpbm-10.58.01/editor/pnmscalefixed.c ---- netpbm-10.58.01/editor/pnmscalefixed.c.security-code 2012-04-09 15:31:34.000000000 +0200 -+++ netpbm-10.58.01/editor/pnmscalefixed.c 2012-04-09 15:40:03.223619538 +0200 -@@ -214,6 +214,8 @@ compute_output_dimensions(const struct c +diff --git a/editor/pnmscalefixed.c b/editor/pnmscalefixed.c +index 884ca31..747cd8f 100644 +--- a/editor/pnmscalefixed.c ++++ b/editor/pnmscalefixed.c +@@ -214,6 +214,7 @@ compute_output_dimensions(const struct cmdline_info cmdline, const int rows, const int cols, int * newrowsP, int * newcolsP) { + overflow2(rows, cols); -+ if (cmdline.pixels) { if (rows * cols <= cmdline.pixels) { *newrowsP = rows; -@@ -265,6 +267,8 @@ compute_output_dimensions(const struct c +@@ -265,6 +266,8 @@ compute_output_dimensions(const struct cmdline_info cmdline, if (*newcolsP < 1) *newcolsP = 1; if (*newrowsP < 1) *newrowsP = 1; -+ ++ + overflow2(*newcolsP, *newrowsP); } -@@ -446,6 +450,9 @@ main(int argc, char **argv ) { +@@ -446,6 +449,9 @@ main(int argc, char **argv ) { unfilled. We can address that by stretching, whereas the other case would require throwing away some of the input. */ -+ ++ + overflow2(newcols, SCALE); + overflow2(newrows, SCALE); sxscale = SCALE * newcols / cols; syscale = SCALE * newrows / rows; -diff -up netpbm-10.58.01/editor/ppmdither.c.security-code netpbm-10.58.01/editor/ppmdither.c ---- netpbm-10.58.01/editor/ppmdither.c.security-code 2012-04-09 15:31:33.000000000 +0200 -+++ netpbm-10.58.01/editor/ppmdither.c 2012-04-09 15:40:03.224619526 +0200 -@@ -355,7 +355,11 @@ dithMatrix(unsigned int const dithPower) - unsigned int const dithMatSize = +diff --git a/editor/ppmdither.c b/editor/ppmdither.c +index ec1b977..e701e09 100644 +--- a/editor/ppmdither.c ++++ b/editor/ppmdither.c +@@ -356,6 +356,11 @@ dithMatrix(unsigned int const dithPower) { (dithDim * sizeof(*dithMat)) + /* pointers */ (dithDim * dithDim * sizeof(**dithMat)); /* data */ -- + + + overflow2(dithDim, sizeof(*dithMat)); + overflow3(dithDim, dithDim, sizeof(**dithMat)); @@ -1033,9 +1016,10 @@ diff -up netpbm-10.58.01/editor/ppmdither.c.security-code netpbm-10.58.01/editor dithMat = malloc(dithMatSize); if (dithMat == NULL) -diff -up netpbm-10.58.01/editor/specialty/pamoil.c.security-code netpbm-10.58.01/editor/specialty/pamoil.c ---- netpbm-10.58.01/editor/specialty/pamoil.c.security-code 2012-04-09 15:31:33.000000000 +0200 -+++ netpbm-10.58.01/editor/specialty/pamoil.c 2012-04-09 15:40:03.224619526 +0200 +diff --git a/editor/specialty/pamoil.c b/editor/specialty/pamoil.c +index 6cb8d3a..6f4bde9 100644 +--- a/editor/specialty/pamoil.c ++++ b/editor/specialty/pamoil.c @@ -112,6 +112,7 @@ main(int argc, char *argv[] ) { tuples = pnm_readpam(ifp, &inpam, PAM_STRUCT_SIZE(tuple_type)); pm_close(ifp); @@ -1044,10 +1028,11 @@ diff -up netpbm-10.58.01/editor/specialty/pamoil.c.security-code netpbm-10.58.01 MALLOCARRAY(hist, inpam.maxval + 1); if (hist == NULL) pm_error("Unable to allocate memory for histogram."); -diff -up netpbm-10.58.01/generator/pbmtext.c.security-code netpbm-10.58.01/generator/pbmtext.c ---- netpbm-10.58.01/generator/pbmtext.c.security-code 2012-04-09 15:31:34.000000000 +0200 -+++ netpbm-10.58.01/generator/pbmtext.c 2012-04-09 15:40:03.225619514 +0200 -@@ -96,12 +96,14 @@ parseCommandLine(int argc, const char ** +diff --git a/generator/pbmtext.c b/generator/pbmtext.c +index 9f4366d..445d718 100644 +--- a/generator/pbmtext.c ++++ b/generator/pbmtext.c +@@ -96,12 +96,14 @@ parseCommandLine(int argc, const char ** argv, for (i = 1; i < argc; ++i) { if (i > 1) { @@ -1057,16 +1042,17 @@ diff -up netpbm-10.58.01/generator/pbmtext.c.security-code netpbm-10.58.01/gener if (text == NULL) pm_error("out of memory allocating space for input text"); strcat(text, " "); - } +- } ++ } + overflow_add(totaltextsize, strlen(argv[i])); totaltextsize += strlen(argv[i]); text = realloc(text, totaltextsize); if (text == NULL) -@@ -712,6 +714,7 @@ getText(const char cmdline_text +@@ -712,6 +714,7 @@ getText(const char cmdline_text[], pm_error("A line of input text is longer than %u characters." "Cannot process.", (unsigned)sizeof(buf)-1); if (lineCount >= maxlines) { -+ overflow2(maxlines, 2); ++ overflow2(maxlines, 2); maxlines *= 2; REALLOCARRAY(text_array, maxlines); if (text_array == NULL) @@ -1074,111 +1060,107 @@ diff -up netpbm-10.58.01/generator/pbmtext.c.security-code netpbm-10.58.01/gener hmargin = fontP->maxwidth; } else { vmargin = fontP->maxheight; -+ overflow2(2, fontP->maxwidth); ++ overflow2(2, fontP->maxwidth); hmargin = 2 * fontP->maxwidth; } } -diff -up netpbm-10.58.01/generator/pgmcrater.c.security-code netpbm-10.58.01/generator/pgmcrater.c ---- netpbm-10.58.01/generator/pgmcrater.c.security-code 2012-04-09 15:31:34.000000000 +0200 -+++ netpbm-10.58.01/generator/pgmcrater.c 2012-04-09 15:40:03.226619502 +0200 -@@ -130,7 +130,7 @@ static void gencraters() - /* Acquire the elevation array and initialize it to mean - surface elevation. */ - -- MALLOCARRAY(aux, SCRX * SCRY); -+ aux = (unsigned short *) malloc3(SCRX, SCRY, sizeof(short)); - if (aux == NULL) - pm_error("out of memory allocating elevation array"); - -diff -up netpbm-10.58.01/lib/libpam.c.security-code netpbm-10.58.01/lib/libpam.c ---- netpbm-10.58.01/lib/libpam.c.security-code 2012-04-09 15:31:38.000000000 +0200 -+++ netpbm-10.58.01/lib/libpam.c 2012-04-09 15:40:03.227619490 +0200 -@@ -220,7 +220,8 @@ allocPamRow(const struct pam * const pam +diff --git a/lib/libpam.c b/lib/libpam.c +index cc6368e..4e10572 100644 +--- a/lib/libpam.c ++++ b/lib/libpam.c +@@ -224,8 +224,9 @@ allocPamRow(const struct pam * const pamP) { unsigned int const bytesPerTuple = allocationDepth(pamP) * sizeof(sample); tuple * tuplerow; - tuplerow = malloc(pamP->width * (sizeof(tuple *) + bytesPerTuple)); +- + overflow_add(sizeof(tuple *), bytesPerTuple); + tuplerow = malloc2(pamP->width, (sizeof(tuple *) + bytesPerTuple)); - ++ if (tuplerow != NULL) { /* Now we initialize the pointers to the individual tuples -diff -up netpbm-10.58.01/lib/libpammap.c.security-code netpbm-10.58.01/lib/libpammap.c ---- netpbm-10.58.01/lib/libpammap.c.security-code 2012-04-09 15:31:38.000000000 +0200 -+++ netpbm-10.58.01/lib/libpammap.c 2012-04-09 15:40:03.228619477 +0200 -@@ -104,6 +104,8 @@ allocTupleIntListItem(struct pam * const + to make this a regulation C two dimensional array. +diff --git a/lib/libpammap.c b/lib/libpammap.c +index 55e1d3f..04b1ba3 100644 +--- a/lib/libpammap.c ++++ b/lib/libpammap.c +@@ -108,7 +108,9 @@ allocTupleIntListItem(struct pam * const pamP) { */ struct tupleint_list_item * retval; +- unsigned int const size = + overflow2(pamP->depth, sizeof(sample)); + overflow_add(sizeof(*retval)-sizeof(retval->tupleint.tuple), pamP->depth*sizeof(sample)); - unsigned int const size = ++ unsigned int const size = sizeof(*retval) - sizeof(retval->tupleint.tuple) + pamP->depth * sizeof(sample); -diff -up netpbm-10.58.01/lib/libpm.c.security-code netpbm-10.58.01/lib/libpm.c ---- netpbm-10.58.01/lib/libpm.c.security-code 2012-04-09 15:31:38.000000000 +0200 -+++ netpbm-10.58.01/lib/libpm.c 2012-04-09 15:40:03.229619464 +0200 -@@ -808,4 +808,53 @@ pm_parse_height(const char * const arg) - } +diff --git a/lib/libpm.c b/lib/libpm.c +index 4374bbe..5ab7f83 100644 +--- a/lib/libpm.c ++++ b/lib/libpm.c +@@ -841,5 +841,53 @@ pm_parse_height(const char * const arg) { + return height; + } +/* + * Maths wrapping + */ -+ + +void __overflow2(int a, int b) +{ -+ if(a < 0 || b < 0) -+ pm_error("object too large"); -+ if(b == 0) -+ return; -+ if(a > INT_MAX / b) -+ pm_error("object too large"); ++ if(a < 0 || b < 0) ++ pm_error("object too large"); ++ if(b == 0) ++ return; ++ if(a > INT_MAX / b) ++ pm_error("object too large"); +} + +void overflow3(int a, int b, int c) +{ -+ overflow2(a,b); -+ overflow2(a*b, c); ++ overflow2(a,b); ++ overflow2(a*b, c); +} + +void overflow_add(int a, int b) +{ -+ if( a > INT_MAX - b) -+ pm_error("object too large"); ++ if( a > INT_MAX - b) ++ pm_error("object too large"); +} + +void *malloc2(int a, int b) +{ -+ overflow2(a, b); -+ if(a*b == 0) -+ pm_error("Zero byte allocation"); -+ return malloc(a*b); ++ overflow2(a, b); ++ if(a*b == 0) ++ pm_error("Zero byte allocation"); ++ return malloc(a*b); +} + +void *malloc3(int a, int b, int c) +{ -+ overflow3(a, b, c); -+ if(a*b*c == 0) -+ pm_error("Zero byte allocation"); -+ return malloc(a*b*c); ++ overflow3(a, b, c); ++ if(a*b*c == 0) ++ pm_error("Zero byte allocation"); ++ return malloc(a*b*c); +} + +void *realloc2(void * a, int b, int c) +{ -+ overflow2(b, c); -+ if(b*c == 0) -+ pm_error("Zero byte allocation"); -+ return realloc(a, b*c); ++ overflow2(b, c); ++ if(b*c == 0) ++ pm_error("Zero byte allocation"); ++ return realloc(a, b*c); +} -diff -up netpbm-10.58.01/lib/pm.h.security-code netpbm-10.58.01/lib/pm.h ---- netpbm-10.58.01/lib/pm.h.security-code 2012-04-09 15:31:38.000000000 +0200 -+++ netpbm-10.58.01/lib/pm.h 2012-04-09 15:40:03.229619464 +0200 -@@ -432,4 +432,11 @@ pm_parse_height(const char * const arg); +diff --git a/lib/pm.h b/lib/pm.h +index e9f1405..da54391 100644 +--- a/lib/pm.h ++++ b/lib/pm.h +@@ -435,5 +435,12 @@ pm_parse_height(const char * const arg); + } #endif - +void *malloc2(int, int); +void *malloc3(int, int, int); +#define overflow2(a,b) __overflow2(a,b) @@ -1186,11 +1168,13 @@ diff -up netpbm-10.58.01/lib/pm.h.security-code netpbm-10.58.01/lib/pm.h +void overflow3(int, int, int); +void overflow_add(int, int); + + #endif -diff -up netpbm-10.58.01/other/pnmcolormap.c.security-code netpbm-10.58.01/other/pnmcolormap.c ---- netpbm-10.58.01/other/pnmcolormap.c.security-code 2012-04-09 15:31:32.000000000 +0200 -+++ netpbm-10.58.01/other/pnmcolormap.c 2012-04-09 15:40:03.230619451 +0200 -@@ -840,6 +840,7 @@ colormapToSquare(struct pam * const pamP +diff --git a/other/pnmcolormap.c b/other/pnmcolormap.c +index 57db432..7195295 100644 +--- a/other/pnmcolormap.c ++++ b/other/pnmcolormap.c +@@ -840,6 +840,7 @@ colormapToSquare(struct pam * const pamP, pamP->width = intsqrt; else pamP->width = intsqrt + 1; @@ -1198,175 +1182,47 @@ diff -up netpbm-10.58.01/other/pnmcolormap.c.security-code netpbm-10.58.01/other } { unsigned int const intQuotient = colormap.size / pamP->width; -diff -up netpbm-10.58.01/urt/README.security-code netpbm-10.58.01/urt/README ---- netpbm-10.58.01/urt/README.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/urt/README 2012-04-09 15:40:03.231619438 +0200 -@@ -18,3 +18,8 @@ in its initializer in the original. But - defines stdout as a variable, so that wouldn't compile. So I changed - it to NULL and added a line to rle_hdr_init to set that field to - 'stdout' dynamically. 2000.06.02 BJH. +diff --git a/urt/Runput.c b/urt/Runput.c +index 3bc562a..645a376 100644 +--- a/urt/Runput.c ++++ b/urt/Runput.c +@@ -202,10 +202,11 @@ RunSetup(rle_hdr * the_hdr) + if ( the_hdr->background != 0 ) + { + register int i; +- register rle_pixel *background = +- (rle_pixel *)malloc( (unsigned)(the_hdr->ncolors + 1) ); +- register int *bg_color; +- /* ++ register rle_pixel *background; ++ register int *bg_color; + -+Redid the code to check for maths overflows and other crawly horrors. -+Removed pipe through and compress support (unsafe) -+ -+Alan Cox -diff -up netpbm-10.58.01/urt/rle_addhist.c.security-code netpbm-10.58.01/urt/rle_addhist.c ---- netpbm-10.58.01/urt/rle_addhist.c.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/urt/rle_addhist.c 2012-04-09 15:40:03.231619438 +0200 -@@ -14,6 +14,8 @@ - * If you modify this software, you should include a notice giving the - * name of the person performing the modification, the date of modification, - * and the reason for such modification. -+ * -+ * 2002-12-19: Fix maths wrapping bugs. Alan Cox - */ - /* - * rle_addhist.c - Add to the HISTORY comment in header -@@ -71,13 +73,19 @@ rle_addhist(char * argv[], - return; - - length = 0; -- for (i = 0; argv[i]; ++i) -+ for (i = 0; argv[i]; ++i) { -+ overflow_add(length, strlen(argv[i])); -+ overflow_add(length+1, strlen(argv[i])); - length += strlen(argv[i]) +1; /* length of each arg plus space. */ -+ } - - time(&temp); - timedate = ctime(&temp); - length += strlen(timedate); /* length of date and time in ASCII. */ - -+ overflow_add(strlen(padding), 4); -+ overflow_add(strlen(histoire), strlen(padding) + 4); -+ overflow_add(length, strlen(histoire) + strlen(padding) + 4); - length += strlen(padding) + 3 + strlen(histoire) + 1; - /* length of padding, "on " and length of history name plus "="*/ - if (in_hdr) /* if we are interested in the old comments... */ -@@ -85,9 +93,12 @@ rle_addhist(char * argv[], - else - old = NULL; - -- if (old && *old) -+ if (old && *old) { -+ overflow_add(length, strlen(old)); - length += strlen(old); /* add length if there. */ -+ } - -+ overflow_add(length, 1); - ++length; /*Cater for the null. */ - - MALLOCARRAY(newc, length); -diff -up netpbm-10.58.01/urt/rle_getrow.c.security-code netpbm-10.58.01/urt/rle_getrow.c ---- netpbm-10.58.01/urt/rle_getrow.c.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/urt/rle_getrow.c 2012-04-09 15:40:03.232619426 +0200 -@@ -17,6 +17,8 @@ - * - * Modified at BRL 16-May-88 by Mike Muuss to avoid Alliant STDC desire - * to have all "void" functions so declared. -+ * -+ * 2002-12-19: Fix maths wrapping bugs. Alan Cox - */ - /* - * rle_getrow.c - Read an RLE file in. -@@ -168,6 +170,7 @@ rle_get_setup(rle_hdr * const the_hdr) { - register char * cp; - - VAXSHORT( comlen, infile ); /* get comment length */ -+ overflow_add(comlen, 1); - evenlen = (comlen + 1) & ~1; /* make it even */ - if ( evenlen ) - { -diff -up netpbm-10.58.01/urt/rle_hdr.c.security-code netpbm-10.58.01/urt/rle_hdr.c ---- netpbm-10.58.01/urt/rle_hdr.c.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/urt/rle_hdr.c 2012-04-09 15:40:03.233619414 +0200 -@@ -14,6 +14,8 @@ - * If you modify this software, you should include a notice giving the - * name of the person performing the modification, the date of modification, - * and the reason for such modification. -+ * -+ * 2002-12-19: Fix maths wrapping bugs. Alan Cox - */ - /* - * rle_hdr.c - Functions to manipulate rle_hdr structures. -@@ -80,7 +82,10 @@ int img_num; - /* Fill in with copies of the strings. */ - if ( the_hdr->cmd != pgmname ) - { -- char *tmp = (char *)malloc( strlen( pgmname ) + 1 ); -+ char *tmp ; -+ -+ overflow_add(strlen(pgmname), 1); -+ tmp = malloc( strlen( pgmname ) + 1 ); - RLE_CHECK_ALLOC( pgmname, tmp, 0 ); - strcpy( tmp, pgmname ); - the_hdr->cmd = tmp; -@@ -88,7 +93,9 @@ int img_num; - - if ( the_hdr->file_name != fname ) - { -- char *tmp = (char *)malloc( strlen( fname ) + 1 ); -+ char *tmp; -+ overflow_add(strlen(fname), 1); -+ tmp = malloc( strlen( fname ) + 1 ); - RLE_CHECK_ALLOC( pgmname, tmp, 0 ); - strcpy( tmp, fname ); - the_hdr->file_name = tmp; -@@ -153,6 +160,7 @@ rle_hdr *from_hdr, *to_hdr; - if ( to_hdr->bg_color ) - { - int size = to_hdr->ncolors * sizeof(int); -+ overflow2(to_hdr->ncolors, sizeof(int)); - to_hdr->bg_color = (int *)malloc( size ); - RLE_CHECK_ALLOC( to_hdr->cmd, to_hdr->bg_color, "background color" ); - memcpy( to_hdr->bg_color, from_hdr->bg_color, size ); -@@ -161,7 +169,7 @@ rle_hdr *from_hdr, *to_hdr; - if ( to_hdr->cmap ) - { - int size = to_hdr->ncmap * (1 << to_hdr->cmaplen) * sizeof(rle_map); -- to_hdr->cmap = (rle_map *)malloc( size ); -+ to_hdr->cmap = (rle_map *)malloc3( to_hdr->ncmap, 1<cmaplen, sizeof(rle_map)); - RLE_CHECK_ALLOC( to_hdr->cmd, to_hdr->cmap, "color map" ); - memcpy( to_hdr->cmap, from_hdr->cmap, size ); - } -@@ -174,11 +182,16 @@ rle_hdr *from_hdr, *to_hdr; - int size = 0; - CONST_DECL char **cp; - for ( cp=to_hdr->comments; *cp; cp++ ) -+ { -+ overflow_add(size, 1); - size++; /* Count the comments. */ -+ } - /* Check if there are really any comments. */ - if ( size ) ++ overflow_add(the_hdr->ncolors,1); ++ background = (rle_pixel *)malloc( (unsigned)(the_hdr->ncolors + 1) ); /* + * If even number of bg color bytes, put out one more to get to + * 16 bit boundary. + */ +@@ -224,7 +225,7 @@ RunSetup(rle_hdr * the_hdr) + /* Big-endian machines are harder */ + register int i, nmap = (1 << the_hdr->cmaplen) * + the_hdr->ncmap; +- register char *h_cmap = (char *)malloc( nmap * 2 ); ++ register char *h_cmap = (char *)malloc2( nmap, 2 ); + if ( h_cmap == NULL ) { -+ overflow_add(size, 1); - size++; /* Copy the NULL pointer, too. */ -+ overflow2(size, sizeof(char *)); - size *= sizeof(char *); - to_hdr->comments = (CONST_DECL char **)malloc( size ); - RLE_CHECK_ALLOC( to_hdr->cmd, to_hdr->comments, "comments" ); -diff -up netpbm-10.58.01/urt/rle.h.security-code netpbm-10.58.01/urt/rle.h ---- netpbm-10.58.01/urt/rle.h.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/urt/rle.h 2012-04-09 15:40:03.233619414 +0200 -@@ -14,6 +14,9 @@ - * If you modify this software, you should include a notice giving the - * name of the person performing the modification, the date of modification, - * and the reason for such modification. -+ * -+ * 2002-12-19: Fix maths wrapping bugs. Alan Cox -+ * Header declarations needed - */ - /* - * rle.h - Global declarations for Utah Raster Toolkit RLE programs. -@@ -160,6 +163,17 @@ rle_hdr /* End of typedef. * + fprintf( stderr, +diff --git a/urt/rle.h b/urt/rle.h +index 8d72cb9..ac65b94 100644 +--- a/urt/rle.h ++++ b/urt/rle.h +@@ -161,6 +161,17 @@ rle_hdr /* End of typedef. */ */ extern rle_hdr rle_dflt_hdr; -+/* ++/* + * Provided by pm library + */ -+ ++ +extern void overflow_add(int, int); +#define overflow2(a,b) __overflow2(a,b) +extern void __overflow2(int, int); @@ -1377,10 +1233,125 @@ diff -up netpbm-10.58.01/urt/rle.h.security-code netpbm-10.58.01/urt/rle.h /* Declare RLE library routines. */ -diff -up netpbm-10.58.01/urt/rle_open_f.c.security-code netpbm-10.58.01/urt/rle_open_f.c ---- netpbm-10.58.01/urt/rle_open_f.c.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/urt/rle_open_f.c 2012-04-09 15:40:03.234619402 +0200 -@@ -163,65 +163,7 @@ dealWithSubprocess(const char * const f +diff --git a/urt/rle_addhist.c b/urt/rle_addhist.c +index b165175..e09ed94 100644 +--- a/urt/rle_addhist.c ++++ b/urt/rle_addhist.c +@@ -70,13 +70,18 @@ rle_addhist(char * argv[], + return; + + length = 0; +- for (i = 0; argv[i]; ++i) ++ for (i = 0; argv[i]; ++i) { ++ overflow_add(length, strlen(argv[i])); ++ overflow_add(length+1, strlen(argv[i])); + length += strlen(argv[i]) +1; /* length of each arg plus space. */ ++ } + + time(&temp); + timedate = ctime(&temp); + length += strlen(timedate); /* length of date and time in ASCII. */ +- ++ overflow_add(strlen(padding), 4); ++ overflow_add(strlen(histoire), strlen(padding) + 4); ++ overflow_add(length, strlen(histoire) + strlen(padding) + 4); + length += strlen(padding) + 3 + strlen(histoire) + 1; + /* length of padding, "on " and length of history name plus "="*/ + if (in_hdr) /* if we are interested in the old comments... */ +@@ -84,8 +89,10 @@ rle_addhist(char * argv[], + else + old = NULL; + +- if (old && *old) ++ if (old && *old) { ++ overflow_add(length, strlen(old)); + length += strlen(old); /* add length if there. */ ++ } + + ++length; /*Cater for the null. */ + +diff --git a/urt/rle_getrow.c b/urt/rle_getrow.c +index bd7d1c8..bd05698 100644 +--- a/urt/rle_getrow.c ++++ b/urt/rle_getrow.c +@@ -168,6 +168,7 @@ rle_get_setup(rle_hdr * const the_hdr) { + register char * cp; + + VAXSHORT( comlen, infile ); /* get comment length */ ++ overflow_add(comlen, 1); + evenlen = (comlen + 1) & ~1; /* make it even */ + if ( evenlen ) + { +diff --git a/urt/rle_hdr.c b/urt/rle_hdr.c +index 1611324..7c9c010 100644 +--- a/urt/rle_hdr.c ++++ b/urt/rle_hdr.c +@@ -80,7 +80,10 @@ int img_num; + /* Fill in with copies of the strings. */ + if ( the_hdr->cmd != pgmname ) + { +- char *tmp = (char *)malloc( strlen( pgmname ) + 1 ); ++ char *tmp; ++ ++ overflow_add(strlen(pgmname), 1); ++ tmp = malloc( strlen(pgmname) + 1 ); + RLE_CHECK_ALLOC( pgmname, tmp, 0 ); + strcpy( tmp, pgmname ); + the_hdr->cmd = tmp; +@@ -88,8 +91,10 @@ int img_num; + + if ( the_hdr->file_name != fname ) + { +- char *tmp = (char *)malloc( strlen( fname ) + 1 ); +- RLE_CHECK_ALLOC( pgmname, tmp, 0 ); ++ char *tmp; ++ overflow_add(strlen(fname), 1); ++ tmp = malloc( strlen( fname ) + 1 ); ++ RLE_CHECK_ALLOC( pgmname, tmp, 0 ); + strcpy( tmp, fname ); + the_hdr->file_name = tmp; + } +@@ -153,6 +158,7 @@ rle_hdr *from_hdr, *to_hdr; + if ( to_hdr->bg_color ) + { + int size = to_hdr->ncolors * sizeof(int); ++ overflow2(to_hdr->ncolors, sizeof(int)); + to_hdr->bg_color = (int *)malloc( size ); + RLE_CHECK_ALLOC( to_hdr->cmd, to_hdr->bg_color, "background color" ); + memcpy( to_hdr->bg_color, from_hdr->bg_color, size ); +@@ -161,7 +167,7 @@ rle_hdr *from_hdr, *to_hdr; + if ( to_hdr->cmap ) + { + int size = to_hdr->ncmap * (1 << to_hdr->cmaplen) * sizeof(rle_map); +- to_hdr->cmap = (rle_map *)malloc( size ); ++ to_hdr->cmap = (rle_map *)malloc3( to_hdr->ncmap, 1<cmaplen, sizeof(rle_map)); + RLE_CHECK_ALLOC( to_hdr->cmd, to_hdr->cmap, "color map" ); + memcpy( to_hdr->cmap, from_hdr->cmap, size ); + } +@@ -173,12 +179,17 @@ rle_hdr *from_hdr, *to_hdr; + { + int size = 0; + CONST_DECL char **cp; +- for ( cp=to_hdr->comments; *cp; cp++ ) ++ for ( cp=to_hdr->comments; *cp; cp++ ) ++ { ++ overflow_add(size, 1); + size++; /* Count the comments. */ ++ } + /* Check if there are really any comments. */ + if ( size ) + { ++ overflow_add(size, 1); + size++; /* Copy the NULL pointer, too. */ ++ overflow2(size, sizeof(char *)); + size *= sizeof(char *); + to_hdr->comments = (CONST_DECL char **)malloc( size ); + RLE_CHECK_ALLOC( to_hdr->cmd, to_hdr->comments, "comments" ); +diff --git a/urt/rle_open_f.c b/urt/rle_open_f.c +index ae8548b..c2ef37d 100644 +--- a/urt/rle_open_f.c ++++ b/urt/rle_open_f.c +@@ -163,65 +163,7 @@ dealWithSubprocess(const char * const file_name, FILE ** const fpP, bool * const noSubprocessP, const char ** const errorP) { @@ -1446,204 +1417,39 @@ diff -up netpbm-10.58.01/urt/rle_open_f.c.security-code netpbm-10.58.01/urt/rle_ } -diff -up netpbm-10.58.01/urt/rle_putcom.c.security-code netpbm-10.58.01/urt/rle_putcom.c ---- netpbm-10.58.01/urt/rle_putcom.c.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/urt/rle_putcom.c 2012-04-09 15:40:03.234619402 +0200 -@@ -14,6 +14,8 @@ - * If you modify this software, you should include a notice giving the - * name of the person performing the modification, the date of modification, - * and the reason for such modification. -+ * -+ * 2002-12-19: Fix maths wrapping bugs. Alan Cox - */ - /* - * rle_putcom.c - Add a picture comment to the header struct. -@@ -98,12 +100,14 @@ rle_putcom(const char * const value, +diff --git a/urt/rle_putcom.c b/urt/rle_putcom.c +index ab2eb20..f6a6ff7 100644 +--- a/urt/rle_putcom.c ++++ b/urt/rle_putcom.c +@@ -98,12 +98,14 @@ rle_putcom(const char * const value, const char * v; const char ** old_comments; int i; - for (i = 2, cp = the_hdr->comments; *cp != NULL; ++i, ++cp) + for (i = 2, cp = the_hdr->comments; *cp != NULL; ++i, ++cp) { -+ overflow_add(i, 1); ++ overflow_add(i, 1); if (match(value, *cp) != NULL) { v = *cp; *cp = value; return v; } -+ } ++ } /* Not found */ /* Can't realloc because somebody else might be pointing to this * comments block. Of course, if this were true, then the -diff -up netpbm-10.58.01/urt/Runput.c.security-code netpbm-10.58.01/urt/Runput.c ---- netpbm-10.58.01/urt/Runput.c.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/urt/Runput.c 2012-04-09 15:40:03.235619390 +0200 -@@ -17,6 +17,8 @@ - * - * Modified at BRL 16-May-88 by Mike Muuss to avoid Alliant STDC desire - * to have all "void" functions so declared. -+ * -+ * 2002-12-19: Fix maths wrapping bugs. Alan Cox - */ - /* - * Runput.c - General purpose Run Length Encoding. -@@ -202,9 +204,11 @@ RunSetup(rle_hdr * the_hdr) - if ( the_hdr->background != 0 ) - { - register int i; -- register rle_pixel *background = -- (rle_pixel *)malloc( (unsigned)(the_hdr->ncolors + 1) ); -+ register rle_pixel *background; - register int *bg_color; -+ -+ overflow_add(the_hdr->ncolors,1); -+ background = (rle_pixel *)malloc( (unsigned)(the_hdr->ncolors + 1) ); - /* - * If even number of bg color bytes, put out one more to get to - * 16 bit boundary. -@@ -224,7 +228,7 @@ RunSetup(rle_hdr * the_hdr) - /* Big-endian machines are harder */ - register int i, nmap = (1 << the_hdr->cmaplen) * - the_hdr->ncmap; -- register char *h_cmap = (char *)malloc( nmap * 2 ); -+ register char *h_cmap = (char *)malloc2( nmap, 2 ); - if ( h_cmap == NULL ) - { - fprintf( stderr, -diff -up netpbm-10.58.01/urt/scanargs.c.security-code netpbm-10.58.01/urt/scanargs.c ---- netpbm-10.58.01/urt/scanargs.c.security-code 2012-04-09 15:31:45.000000000 +0200 -+++ netpbm-10.58.01/urt/scanargs.c 2012-04-09 15:40:03.235619390 +0200 -@@ -38,6 +38,8 @@ - * - * Modified at BRL 16-May-88 by Mike Muuss to avoid Alliant STDC desire - * to have all "void" functions so declared. -+ * -+ * 2002-12-19: Fix maths wrapping bugs. Alan Cox - */ - - #include -@@ -63,8 +65,8 @@ typedef int *ptr; +diff --git a/urt/scanargs.c b/urt/scanargs.c +index f3af334..5e114bb 100644 +--- a/urt/scanargs.c ++++ b/urt/scanargs.c +@@ -62,9 +62,8 @@ typedef int *ptr; /* * Storage allocation macros */ -#define NEW( type, cnt ) (type *) malloc( (cnt) * sizeof( type ) ) -#define RENEW( type, ptr, cnt ) (type *) realloc( ptr, (cnt) * sizeof( type ) ) +- +#define NEW( type, cnt ) (type *) malloc2( (cnt) , sizeof( type ) ) +#define RENEW( type, ptr, cnt ) (type *) realloc2( ptr, (cnt), sizeof( type ) ) - static CONST_DECL char * prformat( CONST_DECL char *, int ); static int isnum( CONST_DECL char *, int, int ); -diff --git a/converter/other/pnmtorle.c b/converter/other/pnmtorle.c -index 180b144..d99d99f 100644 ---- a/converter/other/pnmtorle.c -+++ b/converter/other/pnmtorle.c -@@ -19,6 +19,8 @@ - * If you modify this software, you should include a notice giving the - * name of the person performing the modification, the date of modification, - * and the reason for such modification. -+ * -+ * 2002-12-19: Fix maths wrapping bugs. Alan Cox - */ - /* - * pnmtorle - A program which will convert pbmplus (ppm or pgm) images -diff --git a/converter/ppm/ppmtoilbm.c b/converter/ppm/ppmtoilbm.c -index e114457..7c46307 100644 ---- a/converter/ppm/ppmtoilbm.c -+++ b/converter/ppm/ppmtoilbm.c -@@ -185,6 +185,7 @@ makeValTable(int const oldmaxval, - unsigned int i; - int * table; - -+ overflow_add(oldmaxval, 1); - MALLOCARRAY_NOFAIL(table, oldmaxval + 1); - for (i = 0; i <= oldmaxval; ++i) - table[i] = ROUNDDIV(i * newmaxval, oldmaxval); -@@ -2328,8 +2329,11 @@ main(int argc, char ** argv) { - MALLOCARRAY_NOFAIL(coded_rowbuf, RowBytes(cols)); - for (i = 0; i < RowBytes(cols); ++i) - coded_rowbuf[i] = 0; -- if (DO_COMPRESS) -+ if (DO_COMPRESS) { -+ overflow2(cols,2); -+ overflow_add(cols*2,2); - MALLOCARRAY_NOFAIL(compr_rowbuf, WORSTCOMPR(RowBytes(cols))); -+ } - } - - switch (mode) { -diff --git a/editor/pnmshear.c b/editor/pnmshear.c -index 99fa302..dedce11 100644 ---- a/editor/pnmshear.c -+++ b/editor/pnmshear.c -@@ -15,6 +15,7 @@ - #include - #include - #include -+#include - - #include "pm_c_util.h" - #include "mallocvar.h" -@@ -242,6 +243,11 @@ main(int argc, const char * argv[]) { - - shearfac = fabs(tan(cmdline.angle)); - -+ if(rows * shearfac >= INT_MAX-1) -+ pm_error("image too large"); -+ -+ overflow_add(rows * shearfac, cols+1); -+ - newcols = rows * shearfac + cols + 0.999999; - - pnm_writepnminit(stdout, newcols, rows, newmaxval, newformat, 0); -diff --git a/lib/libpbm1.c b/lib/libpbm1.c -index c96779e..543fa36 100644 ---- a/lib/libpbm1.c -+++ b/lib/libpbm1.c -@@ -78,6 +78,7 @@ pbm_check(FILE * const fileP, - } else { - pm_filepos const bytesPerRow = (cols+7)/8; - pm_filepos const needRasterSize = rows * bytesPerRow; -+ overflow2(bytesPerRow, rows); - pm_check(fileP, checkType, needRasterSize, retvalP); - } - } -diff --git a/converter/other/pnmtosgi.c b/converter/other/pnmtosgi.c -index a8df532..514e9e6 100644 ---- a/converter/other/pnmtosgi.c -+++ b/converter/other/pnmtosgi.c -@@ -176,6 +176,8 @@ compress(ScanElem * const tempArg, - break; - case STORAGE_RLE: { - unsigned int const tabrow = chanNum * rows + row; -+ overflow2(chanNum, rows); -+ overflow_add(chanNum* rows, row); - unsigned int const len = rleCompress(tempArg, cols); - /* writes result into rletemp */ - unsigned int i; -@@ -212,6 +214,7 @@ buildChannels(FILE * const ifP, - ScanElem * temp; - - if (storage != STORAGE_VERBATIM) { -+ overflow2(channels, rows); - MALLOCARRAY_NOFAIL(table, channels * rows); - MALLOCARRAY_NOFAIL(rletemp, WORSTCOMPR(cols)); - } else -diff --git a/converter/other/sgitopnm.c b/converter/other/sgitopnm.c -index 008d537..ea9a2e9 100644 ---- a/converter/other/sgitopnm.c -+++ b/converter/other/sgitopnm.c -@@ -372,10 +372,14 @@ readChannels(FILE * const ifP, - MALLOCARRAY_NOFAIL(image, head->ysize); - } else { - maxchannel = 3; -+ overflow2(head->ysize, maxchannel); - MALLOCARRAY_NOFAIL(image, head->ysize * maxchannel); - } -- if (table) -+ if (table) { -+ overflow2(head->xsize, 2); -+ overflow2(head->xsize*2, 2); - MALLOCARRAY_NOFAIL(temp, WORSTCOMPR(head->xsize)); -+ } - - for (channel = 0; channel < maxchannel; ++channel) { - unsigned int row; + static int _do_scanargs( int argc, char **argv, CONST_DECL char *format, diff --git a/netpbm-werror.patch b/netpbm-werror.patch index 692bbe4..aa73539 100644 --- a/netpbm-werror.patch +++ b/netpbm-werror.patch @@ -1,62 +1,3 @@ -diff --git a/converter/pbm/cmuwmtopbm.c b/converter/pbm/cmuwmtopbm.c -index 5c138c1..1f9bc6c 100644 ---- a/converter/pbm/cmuwmtopbm.c -+++ b/converter/pbm/cmuwmtopbm.c -@@ -48,20 +48,20 @@ readCmuwmHeader(FILE * const ifP, - - rc = pm_readbiglong(ifP, &l); - if (rc == -1 ) -- pm_error(initReadError); -+ pm_error("%s", initReadError); - if ((uint32_t)l != cmuwmMagic) - pm_error("bad magic number in CMU window manager file"); - rc = pm_readbiglong(ifP, &l); - if (rc == -1) -- pm_error(initReadError); -+ pm_error("%s", initReadError); - *colsP = l; - rc = pm_readbiglong(ifP, &l); - if (rc == -1 ) -- pm_error(initReadError); -+ pm_error("%s", initReadError); - *rowsP = l; - rc = pm_readbigshort(ifP, &s); - if (rc == -1) -- pm_error(initReadError); -+ pm_error("%s", initReadError); - *depthP = s; - } - -diff --git a/converter/other/tifftopnm.c b/converter/other/tifftopnm.c -index 3aa2e43..b8ebf39 100644 ---- a/converter/other/tifftopnm.c -+++ b/converter/other/tifftopnm.c -@@ -1459,7 +1459,7 @@ convertRasterInMemory(pnmOut * const pnmOutP, - int ok; - ok = TIFFRGBAImageOK(tif, emsg); - if (!ok) { -- pm_message(emsg); -+ pm_message("%s", emsg); - *statusP = CONV_UNABLE; - } else { - uint32 * raster; -@@ -1479,14 +1479,14 @@ convertRasterInMemory(pnmOut * const pnmOutP, - - ok = TIFFRGBAImageBegin(&img, tif, stopOnErrorFalse, emsg); - if (!ok) { -- pm_message(emsg); -+ pm_message("%s", emsg); - *statusP = CONV_FAILED; - } else { - int ok; - ok = TIFFRGBAImageGet(&img, raster, cols, rows); - TIFFRGBAImageEnd(&img) ; - if (!ok) { -- pm_message(emsg); -+ pm_message("%s", emsg); - *statusP = CONV_FAILED; - } else { - *statusP = CONV_DONE; diff --git a/lib/util/pm_c_util.h b/lib/util/pm_c_util.h index 01a0765..8f5aa01 100644 --- a/lib/util/pm_c_util.h @@ -74,29 +15,3 @@ index 01a0765..8f5aa01 100644 #endif #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) -diff --git a/converter/other/fiasco/pnmtofiasco.c b/converter/other/fiasco/pnmtofiasco.c -index d78ff6b..761dac5 100644 ---- a/converter/other/fiasco/pnmtofiasco.c -+++ b/converter/other/fiasco/pnmtofiasco.c -@@ -170,7 +170,7 @@ main (int argc, char **argv) - return 0; - else - { -- fprintf (stderr, fiasco_get_error_message ()); -+ fprintf (stderr, "%s", fiasco_get_error_message ()); - fprintf (stderr, "\n"); - return 1; - } -diff --git a/converter/other/fiasco/params.c b/converter/other/fiasco/params.c -index a4d843a..9659e9f 100644 ---- a/converter/other/fiasco/params.c -+++ b/converter/other/fiasco/params.c -@@ -656,7 +656,7 @@ usage (const param_t *params, const char *progname, const char *synopsis, - fprintf (stderr, "Usage: %s [OPTION]...%s\n", progname, - non_opt_string ? non_opt_string : " "); - if (synopsis != NULL) -- fprintf (stderr, synopsis); -+ fprintf (stderr, "%s\n", synopsis); - fprintf (stderr, "\n\n"); - fprintf (stderr, "Mandatory or optional arguments to long options " - "are mandatory or optional\nfor short options too. " diff --git a/netpbm-xwdfix.patch b/netpbm-xwdfix.patch index 88626c7..0522727 100644 --- a/netpbm-xwdfix.patch +++ b/netpbm-xwdfix.patch @@ -1,6 +1,8 @@ ---- netpbm-10.35/converter/other/xwdtopnm.c.xwdfix 2006-09-18 13:24:50.000000000 +0200 -+++ netpbm-10.35/converter/other/xwdtopnm.c 2006-09-18 13:27:26.000000000 +0200 -@@ -945,7 +945,7 @@ getpix(pixelReader * const rdrP) { +diff --git a/converter/other/xwdtopnm.c b/converter/other/xwdtopnm.c +index d49a2b0..45d66b4 100644 +--- a/converter/other/xwdtopnm.c ++++ b/converter/other/xwdtopnm.c +@@ -1025,7 +1025,7 @@ pixelReader_getbits(pixelReader * const rdrP, unsigned long const bitsToTakeMask = lsbmask[nBitsToTake]; /* E.g. if nbitsToTake is 4, this is 0x0000000F */ diff --git a/netpbm.spec b/netpbm.spec index d94b6e7..5ecdde8 100644 --- a/netpbm.spec +++ b/netpbm.spec @@ -1,7 +1,7 @@ Summary: A library for handling different graphics file formats Name: netpbm -Version: 10.66.02 -Release: 7%{?dist} +Version: 10.71.02 +Release: 1%{?dist} # See copyright_summary for details License: BSD and GPLv2 and IJG and MIT and Public Domain Group: System Environment/Libraries @@ -32,10 +32,10 @@ Patch21: netpbm-cmuwtopbm.patch Patch22: netpbm-pamtojpeg2k.patch Patch23: netpbm-manfix.patch Patch24: netpbm-ppmtopict.patch -Patch25: netpbm-pnmtopclxl.patch Patch26: netpbm-werror.patch Patch27: netpbm-disable-pbmtog3.patch Patch28: netpbm-pnmtops.patch +Patch29: netpbm-config.patch BuildRequires: libjpeg-devel, libpng-devel, libtiff-devel, flex BuildRequires: libX11-devel, python, jasper-devel, libxml2-devel BuildRequires: ghostscript-core @@ -109,10 +109,10 @@ netpbm-doc. You'll also need to install the netpbm-progs package. %patch22 -p1 -b .pamtojpeg2kfix %patch23 -p1 -b .manfix %patch24 -p1 -b .ppmtopict -%patch25 -p1 -b .pnmtopclxl %patch26 -p1 -b .werror %patch27 -p1 -b .disable-pbmtog3 %patch28 -p1 -b .pnmtops +%patch29 -p1 -b .config sed -i 's/STRIPFLAG = -s/STRIPFLAG =/g' config.mk.in rm -rf converter/other/jpeg2000/libjasper/ @@ -156,10 +156,7 @@ make \ TIFFLIB_DIR=%{_libdir} \ LINUXSVGALIB="NONE" \ X11LIB=%{_libdir}/libX11.so \ - XML2LIBS="NONE" \ - JASPERLIB="" \ - JASPERDEPLIBS="-ljasper" \ - JASPERHDR_DIR="/usr/include/jasper" + XML2LIBS="NONE" # prepare man files cd userguide @@ -265,6 +262,9 @@ rm -rf $RPM_BUILD_ROOT %doc userguide/* %changelog +* Mon Aug 10 2015 Petr Hracek - 10.71.02-1 +- Update to the latest upstream release (#1252352) + * Thu Aug 06 2015 Petr Hracek - 10.66.02-7 - remove doc/copyright_summary (#1219743) diff --git a/netpbm2tar.sh b/netpbm2tar.sh index 5fa7fa8..e0f920d 100755 --- a/netpbm2tar.sh +++ b/netpbm2tar.sh @@ -14,7 +14,7 @@ if [[ -z $VERSION ]]; then fi NETPBM_NAME="netpbm-$VERSION" TEMP_DIR="/var/tmp/netpbm" -TARBALL="$TEMP_DIR/$NETPBM_NAME.tar.gz" +TARBALL="$TEMP_DIR/$NETPBM_NAME.tar.xz" mkdir -p $TEMP_DIR pushd $TEMP_DIR svn checkout https://netpbm.svn.sourceforge.net/svnroot/netpbm/advanced $NETPBM_NAME @@ -22,7 +22,7 @@ svn checkout https://netpbm.svn.sourceforge.net/svnroot/netpbm/userguide $NETPBM svn checkout https://netpbm.svn.sourceforge.net/svnroot/netpbm/trunk/test $NETPBM_NAME/test find -name '\.svn' -type d -print0 | xargs -0 rm -rf rm -rf $NETPBM_NAME/converter/ppm/ppmtompeg/ -tar -czvf $NETPBM_NAME.tar.gz $NETPBM_NAME +tar -cJvf $NETPBM_NAME.tar.xz $NETPBM_NAME rm -rf $NETPBM_NAME/ popd if [[ -f "$TARBALL" ]]; then diff --git a/sources b/sources index 1f41b8d..5be4b4e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -dcb7de91384d630eb399e48c71158f3d netpbm-10.66.02.tar.xz +24df6a5baf36fa8943f046568726fd57 netpbm-10.71.02.tar.xz