From 780b594ecd430295e26821ab1ba769822242e710 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 10 2018 05:19:48 +0000 Subject: import netpbm-10.79.00-7.el7 --- diff --git a/.gitignore b/.gitignore index 15df619..5b5f66b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/netpbm-10.61.02.tar.xz +SOURCES/netpbm-10.79.00.tar.xz diff --git a/.netpbm.metadata b/.netpbm.metadata index e44f061..b07f9d1 100644 --- a/.netpbm.metadata +++ b/.netpbm.metadata @@ -1 +1 @@ -4b6239cd9564fbcebb0e6d87a1ef3c2ecfaa5a14 SOURCES/netpbm-10.61.02.tar.xz +8ed7835000a9c915aed6ee33376375b737a0f979 SOURCES/netpbm-10.79.00.tar.xz diff --git a/SOURCES/netpbm-compare-same-images.patch b/SOURCES/netpbm-compare-same-images.patch deleted file mode 100644 index c629c4c..0000000 --- a/SOURCES/netpbm-compare-same-images.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/analyzer/pnmpsnr.c b/analyzer/pnmpsnr.c -index ce2708b..b04316c 100644 ---- a/analyzer/pnmpsnr.c -+++ b/analyzer/pnmpsnr.c -@@ -55,14 +55,14 @@ validateInput(struct pam const pam1, - "maxval of one of them.", - (unsigned int) pam1.maxval, (unsigned int) pam2.maxval); - -- if (streq(pam1.tuple_type, pam2.tuple_type)) -+ if (!streq(pam1.tuple_type, pam2.tuple_type)) - pm_error("images are not of the same type. The tuple types are " - "'%s' and '%s', respectively.", - pam1.tuple_type, pam2.tuple_type); - -- if (streq(pam1.tuple_type, PAM_PBM_TUPLETYPE) && -- streq(pam1.tuple_type, PAM_PGM_TUPLETYPE) && -- streq(pam1.tuple_type, PAM_PPM_TUPLETYPE)) -+ if (!streq(pam1.tuple_type, PAM_PBM_TUPLETYPE) && -+ !streq(pam1.tuple_type, PAM_PGM_TUPLETYPE) && -+ !streq(pam1.tuple_type, PAM_PPM_TUPLETYPE)) - pm_error("Images are not of a PNM type. Tuple type is '%s'", - pam1.tuple_type); - } diff --git a/SOURCES/netpbm-docfix.patch b/SOURCES/netpbm-docfix.patch index a88c65b..33b3b77 100644 --- a/SOURCES/netpbm-docfix.patch +++ b/SOURCES/netpbm-docfix.patch @@ -1,18 +1,6 @@ -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, - &adjacentSpec, 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 +diff -urNp old/userguide/cameratopam.html new/userguide/cameratopam.html +--- old/userguide/cameratopam.html 2017-09-05 09:05:16.000000000 +0200 ++++ new/userguide/cameratopam.html 2017-09-05 13:16:33.622352535 +0200 @@ -25,10 +25,10 @@ cameratopam - convert raw camera image t [-balance_camera] [-red_scale=float] @@ -35,7 +23,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
By default, cameratoapm clips all colors to prevent pink hues in the highlights. Combine this option with @@ -52,9 +40,9 @@ 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 +diff -urNp old/userguide/fiascotopnm.html new/userguide/fiascotopnm.html +--- old/userguide/fiascotopnm.html 2017-09-05 09:05:16.000000000 +0200 ++++ new/userguide/fiascotopnm.html 2017-09-05 13:32:51.810458154 +0200 @@ -51,7 +51,7 @@ the output file(s) are written to the fi this list. Otherwise, the current directory is used to store the output file(s). @@ -73,26 +61,26 @@ 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,8 @@ following methods (in the specified orde
  • --config=name -
    -h, --info -+
    -h, --help -
    +-
    -Print brief help, then exit. - -
    -H, --help -
    -Print detailed help, then exit. ++
    -h, --help +Print help, then exit. -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 -urNp old/userguide/pamperspective.html new/userguide/pamperspective.html +--- old/userguide/pamperspective.html 2017-09-05 09:05:16.000000000 +0200 ++++ new/userguide/pamperspective.html 2017-09-05 13:23:15.869997105 +0200 +@@ -220,7 +220,7 @@ default rectangle as the "frame." The vi 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,9 +89,21 @@ 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 +diff -urNp old/converter/pbm/pbmtoepson.c new/converter/pbm/pbmtoepson.c +--- old/converter/pbm/pbmtoepson.c 2018-01-04 14:26:14.740024843 +0100 ++++ new/converter/pbm/pbmtoepson.c 2018-01-04 14:28:47.970518766 +0100 +@@ -75,7 +75,7 @@ parseCommandLine(int ar + &dpiSpec, 0); + OPTENT3(0, "adjacent", OPT_FLAG, NULL, + &adjacentSpec, 0); +- OPTENT3(0, "nonadjacent", OPT_FLAG, NULL, ++ OPTENT3(0, "noadjacent", OPT_FLAG, NULL, + &nonadjacentSpec, 0); + + opt.opt_table = option_def; +diff -urNp old/userguide/pbmtoepson.html new/userguide/pbmtoepson.html +--- old/userguide/pbmtoepson.html 2018-01-04 14:26:14.586024719 +0100 ++++ new/userguide/pbmtoepson.html 2018-01-04 14:27:56.466847698 +0100 @@ -18,7 +18,7 @@ pbmtoepson - convert a PBM image into Ep [-dpi=n] [-protocol={escp9|escp}] @@ -120,5 +120,5 @@ diff -up netpbm-10.47.12/userguide/pbmtoepson.html.docfix netpbm-10.47.12/usergu -

    -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/SOURCES/netpbm-manfix.patch b/SOURCES/netpbm-manfix.patch index d459db4..54df85f 100644 --- a/SOURCES/netpbm-manfix.patch +++ b/SOURCES/netpbm-manfix.patch @@ -1,10 +1,9 @@ -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 -urNp old/userguide/avstopam.html new/userguide/avstopam.html +--- old/userguide/avstopam.html 2017-09-05 13:58:08.338559550 +0200 ++++ new/userguide/avstopam.html 2017-09-05 14:00:27.371039472 +0200 @@ -1,8 +1,7 @@ -- + - -+ + Avstopam User Manual @@ -12,15 +11,10 @@ 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 -urNp old/userguide/escp2topbm.html new/userguide/escp2topbm.html +--- old/userguide/escp2topbm.html 2017-09-05 13:58:08.335559561 +0200 ++++ new/userguide/escp2topbm.html 2017-09-05 14:01:20.226842694 +0200 +@@ -6,6 +6,7 @@ Updated: 14 July 2015
    Table Of Contents @@ -28,10 +22,10 @@ diff -up netpbm-10.59.03/userguide/escp2topbm.html.manfix netpbm-10.59.03/usergu 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 -@@ -5,10 +5,12 @@ +diff -urNp old/userguide/faxformat.html new/userguide/faxformat.html +--- old/userguide/faxformat.html 2017-09-05 13:58:08.337559553 +0200 ++++ new/userguide/faxformat.html 2017-09-05 14:02:33.322571279 +0200 +@@ -5,10 +5,11 @@ Updated: 03 December 2008
    @@ -39,14 +33,14 @@ diff -up netpbm-10.59.03/userguide/faxformat.html.manfix netpbm-10.59.03/usergui

    This page, part of the Netpbm user's guide, describes FAX formats in relation to Netpbm facilities. - +- +

    DESCRIPTION

    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 -urNp old/userguide/pampaintspill.html new/userguide/pampaintspill.html +--- old/userguide/pampaintspill.html 2017-09-05 13:58:08.338559550 +0200 ++++ new/userguide/pampaintspill.html 2017-09-05 14:03:32.625351620 +0200 @@ -1,8 +1,7 @@ - @@ -65,9 +59,9 @@ 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 +diff -urNp old/userguide/pamrecolor.html new/userguide/pamrecolor.html +--- old/userguide/pamrecolor.html 2017-09-05 13:58:08.336559557 +0200 ++++ new/userguide/pamrecolor.html 2017-09-05 14:04:34.714122098 +0200 @@ -1,8 +1,7 @@ - + @@ -87,9 +81,9 @@ diff -up netpbm-10.59.03/userguide/pamrecolor.html.manfix netpbm-10.59.03/usergu

    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 +diff -urNp old/userguide/pamsistoaglyph.html new/userguide/pamsistoaglyph.html +--- old/userguide/pamsistoaglyph.html 2017-09-05 13:58:08.334559565 +0200 ++++ new/userguide/pamsistoaglyph.html 2017-09-05 14:05:25.865944327 +0200 @@ -1,8 +1,7 @@ - @@ -100,27 +94,42 @@ 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 -urNp old/userguide/pamstereogram.html new/userguide/pamstereogram.html +--- old/userguide/pamstereogram.html 2017-09-05 13:58:08.337559553 +0200 ++++ new/userguide/pamstereogram.html 2017-09-05 14:13:28.523959069 +0200 +@@ -1,5 +1,5 @@ +- +- + + - Pamtoavs User Manual -- + Pamstereogram User Manual +@@ -10,7 +10,7 @@ - -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 +

    Updated: 19 June 2015

    + +-

    Table Of Contents

    ++

    Table Of Contents

    + + +

    NAME

    +diff -urNp old/userguide/pamtoavs.html new/userguide/pamtoavs.html +--- old/userguide/pamtoavs.html 2017-09-05 13:58:08.329559583 +0200 ++++ new/userguide/pamtoavs.html 2017-09-05 14:05:49.299863901 +0200 +@@ -1,5 +1,5 @@ + +- ++ + + Pamtoavs User Manual + +diff -urNp old/userguide/pamtooctaveimg.html new/userguide/pamtooctaveimg.html +--- old/userguide/pamtooctaveimg.html 2017-09-05 13:58:08.335559561 +0200 ++++ new/userguide/pamtooctaveimg.html 2017-09-05 14:06:21.825752356 +0200 @@ -1,8 +1,7 @@ -- + - -+ + Pamtooctaveimg User Manual @@ -128,9 +137,9 @@ 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 -urNp old/userguide/pnmflip.html new/userguide/pnmflip.html +--- old/userguide/pnmflip.html 2017-09-05 13:58:08.336559557 +0200 ++++ new/userguide/pnmflip.html 2017-09-05 14:07:15.065963977 +0200 @@ -4,9 +4,11 @@

    pnmflip

    @@ -143,9 +152,9 @@ 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 -urNp old/userguide/pnmmercator.html new/userguide/pnmmercator.html +--- old/userguide/pnmmercator.html 2017-09-05 13:58:08.334559565 +0200 ++++ new/userguide/pnmmercator.html 2017-09-05 14:08:08.305214742 +0200 @@ -1,7 +1,6 @@ - + @@ -155,18 +164,9 @@ 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 -urNp old/userguide/ppmtogif.html new/userguide/ppmtogif.html +--- old/userguide/ppmtogif.html 2017-09-05 13:58:08.337559553 +0200 ++++ new/userguide/ppmtogif.html 2017-09-05 14:09:51.450583126 +0200 @@ -4,11 +4,14 @@

    ppmtogif

    @@ -182,24 +182,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/SOURCES/netpbm-manual-pages.patch b/SOURCES/netpbm-manual-pages.patch index 79f0992..b5fbbea 100644 --- a/SOURCES/netpbm-manual-pages.patch +++ b/SOURCES/netpbm-manual-pages.patch @@ -1,357 +1,54 @@ -diff --git a/userguide/cameratopam.html b/userguide/cameratopam.html -index 7a6391e..89f6939 100644 ---- a/userguide/cameratopam.html -+++ b/userguide/cameratopam.html -@@ -163,7 +163,7 @@ means. - href="http://www.cybercom.net/~dcoffin/dcraw/">dcraw by Dave - Coffin, by Bryan Henderson in April 2005. Bryan replaced the part - that generates the Netpbm output image and removed the Adobe Photoshop --output function. Bryan changed the command syntax and and made other -+output function. Bryan changed the command syntax and made other - small changes to make the program consistent with Netpbm. He also - split the source code into manageable pieces (dcraw has a - single 5000 line source file). -diff --git a/userguide/fiascotopnm.html b/userguide/fiascotopnm.html -index 2cd4f01..f1f1b17 100644 ---- a/userguide/fiascotopnm.html -+++ b/userguide/fiascotopnm.html -@@ -76,7 +76,7 @@ Set magnification of the decompressed image. Positive values enlarge - and negative values reduce the image width and height by a factor of - 2^|N|. +diff -urNp old/userguide/libnetpbm_ug.html new/userguide/libnetpbm_ug.html +--- old/userguide/libnetpbm_ug.html 2017-09-05 14:20:09.734743404 +0200 ++++ new/userguide/libnetpbm_ug.html 2017-09-05 14:47:30.496705483 +0200 +@@ -374,7 +374,7 @@ plain format. +

    Reference

    --
    -s N, --smooth=N -+
    -s N, --smoothing=N -
    - Smooth decompressed image(s) along the partitioning borders by the - given amount N. N is 1 (minimum) to 100 (maximum); default -@@ -88,6 +88,10 @@ FIASCO file is used (defined by the FIASCO coder). - Set number of frames per second to N. When using this option, - the frame rate specified in the FIASCO file is overridden. +

    The Libnetpbm Netpbm Image +-Processing Manual describes the the libnetpbm functions for ++Processing Manual describes the libnetpbm functions for + processing image data. -+

    --verbose=N -+
    -+Set verbose of fiascotopnm to N. -+ -
    -v, --version -
    - Print fiascotopnm version number, then exit. -diff --git a/userguide/pamdepth.html b/userguide/pamdepth.html -index 1a2b5fd..c188e44 100644 ---- a/userguide/pamdepth.html -+++ b/userguide/pamdepth.html -@@ -52,7 +52,7 @@ files before April 2000. - pnmdepth, by Jef Poskanzer. pamdepth is backward compatible - with pnmdepth and adds the ability to process arbitrary PAM images - and the ability to process multi-image input streams. pnmdepth --handled only PNM images and ignored all but the the first in any stream. -+handled only PNM images and ignored all but the first in any stream. +

    The Libnetpbm Utility Manual +diff -urNp old/userguide/pamfunc.html new/userguide/pamfunc.html +--- old/userguide/pamfunc.html 2017-09-05 14:20:09.738743398 +0200 ++++ new/userguide/pamfunc.html 2017-09-05 14:47:41.760644848 +0200 +@@ -57,7 +57,7 @@ output image. + and bit string (such as and with 01001000). For the arithmetic functions, the + function arguments and results are the fraction that a sample is of the + maxval, i.e. normal interpretation of PAM tuples. But for the bit string +-functions, the value is the the bit string whose value as a binary cipher is ++functions, the value is the bit string whose value as a binary cipher is + the sample value, and the maxval indicates the width of the bit string. -


    -

    Table Of Contents

    -diff --git a/userguide/pamdice.html b/userguide/pamdice.html -index 0659e15..9053113 100644 ---- a/userguide/pamdice.html -+++ b/userguide/pamdice.html -@@ -139,7 +139,7 @@ in each direction. - pgmslice, - ppmglobe - pnm --pnm -+pam - -
    -

    Table Of Contents

    -diff --git a/userguide/pamstereogram.html b/userguide/pamstereogram.html -index c337547..652b887 100644 ---- a/userguide/pamstereogram.html -+++ b/userguide/pamstereogram.html -@@ -319,7 +319,7 @@ be. Lower (darker) numbers mean further from the eye. - -

    Input Images

    - --

    pamstereogram pays no attention the the image's tuple -+

    pamstereogram pays no attention the image's tuple - type and ignores all planes other than plane 0.

    - -

    Like any Netpbm program, pamstereogram will accept PNM -diff --git a/userguide/pamtofits.html b/userguide/pamtofits.html -index 445b326..0ecc806 100644 ---- a/userguide/pamtofits.html -+++ b/userguide/pamtofits.html -@@ -54,7 +54,7 @@ approximation. -

    Pixel Order

    - -

    The FITS specification does not specify which data in the file corresponds --to which pixel in the image (i.e. which bytes are the the top left pixel, -+to which pixel in the image (i.e. which bytes are the top left pixel, - etc.). Netpbm uses the common sense, most popular arrangement: row major, top - to bottom, left to right. That means in a 10 wide by 20 high image, the first - 10 pixels in the file are the top row and the last 10 are the bottom row. -diff --git a/userguide/pamtojpeg2k.html b/userguide/pamtojpeg2k.html -index 06b6113..046d740 100644 ---- a/userguide/pamtojpeg2k.html -+++ b/userguide/pamtojpeg2k.html -@@ -181,7 +181,7 @@ its goal is similar to JPEG. It has two main differences from JPEG. -

    One difference is that it does a much better job on most images of - throwing out information in order to achieve a smaller output. That - means when you reconstruct the image from the resulting compressed --file, it looks a lot closer to the image you started with with -+file, it looks a lot closer to the image you started with - JPEG-2000 than with JPEG, for the same compressed file size. Or, looked - at another way, with JPEG-2000 you get a much smaller file than with - JPEG for the same image quality. -diff --git a/userguide/pamtotiff.html b/userguide/pamtotiff.html -index f07d227..c7a48a0 100644 ---- a/userguide/pamtotiff.html -+++ b/userguide/pamtotiff.html -@@ -124,7 +124,7 @@ format it produces are therefore controlled by that library. -

    By default, pamtotiff creates a TIFF file with no - compression. This is your best bet most of the time. If you want to - try another compression scheme or tweak some of the other even more --obscure output options, there are a number of options which which to -+obscure output options, there are a number of options which to - play. - -

    Before Netpbm 8.4 (April 2000), the default was to use LZW compression. -diff --git a/userguide/pamtouil.html b/userguide/pamtouil.html -index 1074119..6c2356b 100644 ---- a/userguide/pamtouil.html -+++ b/userguide/pamtouil.html -@@ -57,7 +57,7 @@ in the RGB database. -   -

    SEE ALSO

    - --pam -+pamstack - pam - ppm - -diff --git a/userguide/pamundice.html b/userguide/pamundice.html -index 2b789b4..bf366d6 100644 ---- a/userguide/pamundice.html -+++ b/userguide/pamundice.html -@@ -208,7 +208,7 @@ clips the bottom edge of each image before joining it to the one below. - pnmindex, - pnmtile, - pnm --pnm -+pam - -
    -

    Table Of Contents

    -diff --git a/userguide/pbm.html b/userguide/pbm.html -index 63dfa40..7db4886 100644 ---- a/userguide/pbm.html -+++ b/userguide/pbm.html -@@ -136,7 +136,7 @@ P1 - accepting anything that looks remotely like a bitmap. - -

    All characters referred to herein are encoded in ASCII. --"newline" refers the the character known in ASCII as Line -+"newline" refers the character known in ASCII as Line - Feed or LF. A "white space" character is space, CR, LF, - TAB, VT, or FF (I.e. what the ANSI standard C isspace() function - calls white space). -diff --git a/userguide/pbmtolj.html b/userguide/pbmtolj.html -index ce7e9bb..6da4555 100644 ---- a/userguide/pbmtolj.html -+++ b/userguide/pbmtolj.html -@@ -83,7 +83,7 @@ and end of the output file. - -

    -copies - --
    Specifies the the number of copies. The default is 1. This option -+
    Specifies the number of copies. The default is 1. This option - controls the "number of copies" printer control; - pbmtolj generates only one copy of the image. - -diff --git a/userguide/pgm.html b/userguide/pgm.html -index d75c9ef..7df1abc 100644 ---- a/userguide/pgm.html -+++ b/userguide/pgm.html -@@ -153,7 +153,7 @@ P2 - accepting anything that looks remotely like a PGM. - -

    All characters referred to herein are encoded in ASCII. --"newline" refers the the character known in ASCII as Line -+"newline" refers the character known in ASCII as Line - Feed or LF. A "white space" character is space, CR, LF, - TAB, VT, or FF (I.e. what the ANSI standard C isspace() function - calls white space). -diff --git a/userguide/pngtopam.html b/userguide/pngtopam.html -index 8185843..09406ef 100644 ---- a/userguide/pngtopam.html -+++ b/userguide/pngtopam.html -@@ -269,7 +269,7 @@ change to the package in Netpbm's renaissance. It and pnmtopng - were simply copied from the - pnmtopng package by Greg Roelofs. Those were based on --simpler reference applications by by Alexander Lehmann -+simpler reference applications by Alexander Lehmann - <alex@hal.rhein-main.de> and Willem van Schaik - <willem@schaik.com> and distributed with their PNG library. - -diff --git a/userguide/pnmnorm.html b/userguide/pnmnorm.html -index c4d2558..5d3ca49 100644 ---- a/userguide/pnmnorm.html -+++ b/userguide/pnmnorm.html -@@ -146,7 +146,7 @@ value 99 or the white value 101. - option. Sometimes, too much contrast is a bad thing. If your - intensities are all concentrated in the middle, -bpercent=2 and - -wpercent=1 might mean that an intensity of 60 gets stretched --up to 100 and and intensity of 20 gets stretched down to zero, for a -+up to 100 and intensity of 20 gets stretched down to zero, for a - range expansion of 150% (from a range of 40 to a range of 100). That - much stretching means two adjacent pixels that used to differ in - intensity by 4 units now differ by 10, and that might be unsightly. -diff --git a/userguide/pnmtopalm.html b/userguide/pnmtopalm.html -index 94aa6ff..9ca9c0d 100644 ---- a/userguide/pnmtopalm.html -+++ b/userguide/pnmtopalm.html -@@ -164,7 +164,7 @@ the -colormap option, for much the same reason. - -

    -withdummy +

    Arithmetic functions

    +diff -urNp old/userguide/pbmtextps.html new/userguide/pbmtextps.html +--- old/userguide/pbmtextps.html 2017-09-05 14:20:09.736743401 +0200 ++++ new/userguide/pbmtextps.html 2017-09-05 14:47:58.840553598 +0200 +@@ -185,7 +185,7 @@ edge of the type. See Netpbm. - --

    qrttoppm reads a QRT file as input and and produces a PPM -+

    qrttoppm reads a QRT file as input and produces a PPM - image as output. - -   -diff --git a/userguide/sbigtopgm.html b/userguide/sbigtopgm.html -index 400bcaf..78f9454 100644 ---- a/userguide/sbigtopgm.html -+++ b/userguide/sbigtopgm.html -@@ -22,7 +22,7 @@ sbigtopgm - convert an SBIG CCDOPS file to PGM - -

    This program is part of Netpbm. - --

    sbigtopgm reads an an image file in the native format used -+

    sbigtopgm reads an image file in the native format used - by the Santa Barbara Instrument Group (SBIG) astronomical CCD cameras, - and produces a PGM image as output. Additional information on SBIG - cameras and documentation of the file format is available at the Web -diff --git a/userguide/srftopam.html b/userguide/srftopam.html -index b27f133..c98586f 100644 ---- a/userguide/srftopam.html -+++ b/userguide/srftopam.html -@@ -30,7 +30,7 @@ - -

    This program is part of Netpbm.

    - --

    srftopam reads a a SRF image file as input and produces a -+

    srftopam reads a SRF image file as input and produces a - multi-image stream of PAM images as output. - -

    This program performs the inverse of the conversion that pamtosrf -diff --git a/userguide/sunicontopnm.html b/userguide/sunicontopnm.html -index 6ccbcde..0290f7b 100644 ---- a/userguide/sunicontopnm.html -+++ b/userguide/sunicontopnm.html -@@ -54,7 +54,7 @@ mostly XPM files. - xbmtoppm, - infotopam, - pbm --pbm -+pgm +-These options control the the margins added to the image, measured from ++These options control the margins added to the image, measured from + the text baseline. See Margins for details. +

    Sizes are in points, as a floating point number. +diff -urNp old/userguide/pbmtog3.html new/userguide/pbmtog3.html +--- old/userguide/pbmtog3.html 2017-09-05 14:20:09.735743403 +0200 ++++ new/userguide/pbmtog3.html 2017-09-05 14:48:55.648255793 +0200 +@@ -77,7 +77,7 @@ You cannot specify both.

    HISTORY

    -diff --git a/userguide/xpmtoppm.html b/userguide/xpmtoppm.html -index c7c857b..f96b249 100644 ---- a/userguide/xpmtoppm.html -+++ b/userguide/xpmtoppm.html -@@ -46,7 +46,7 @@ alpha output to Standard Output and discards the image. - the alpha output file. - -

    xpmtoppm can't handle a line longer than 8K characters in --the the XPM input. If an input line exceeds this limit, -+the XPM input. If an input line exceeds this limit, - xpmtoppm quits with an error message to that effect. Before - Netpbm 10.30 (October 2005), the limit was 2K. - -diff --git a/userguide/infotopam.html b/userguide/infotopam.html -index 9818c59..177f4d4 100644 ---- a/userguide/infotopam.html -+++ b/userguide/infotopam.html -@@ -110,7 +110,7 @@ using the -forcecolor option.

    -

    To override the colors, first specify how many colors to override using - -numcolors, then specify an (index color) pair for each color - you want to override, where index is a value from 0 to 3 and -- color the the new color for that index. Specify color as -+ color the new color for that index. Specify color as - described for the ppm_parsecolor() - argument.

  • - -diff --git a/userguide/pbmtoppa.html b/userguide/pbmtoppa.html -index f2ccf11..e0abe05 100644 ---- a/userguide/pbmtoppa.html -+++ b/userguide/pbmtoppa.html -@@ -254,7 +254,7 @@ StartEntry: DeskJet720C -   About: { \ -         This driver supports the HP DeskJet 720C \ -         inkjet printer. \ --        It does does not support color printing. \ -+        It does not support color printing. \ -         IMPORTANT! Insert \ -              "- | pbm2ppa -" \ -         in the "Extra GS Options" field.\ -diff --git a/userguide/pnmgamma.html b/userguide/pnmgamma.html -index 574d7d9..4c884f5 100644 ---- a/userguide/pnmgamma.html -+++ b/userguide/pnmgamma.html -@@ -242,7 +242,7 @@ the output is the same as that of the input. +

    Before Netpbm 10.79 (June 2017), there was a different program by the same +-name in Netpbm, which was written by by Paul Haeberli ++name in Netpbm, which was written by Paul Haeberli + <paul@manray.sgi.com> in 1989 + and then modified extensively by others. -

    Because the transformation is not linear, you need a greater maxval - in the output in order not to lose any information from the input. --For example, if you convert to radiance-linear sample values with with -+For example, if you convert to radiance-linear sample values with - -ungamma -bt709ramp and default gamma value, and your maxval is - 255 on both input and output, 3 different input sample values all - generate output sample value 254. In order to have a different output -diff --git a/userguide/ppmtompeg.html b/userguide/ppmtompeg.html -deleted file mode 100644 -index 4fa4a53..0000000 ---- a/userguide/ppmtompeg.html -+++ /dev/null +diff -urNp old/userguide/ppmtompeg.html new/userguide/ppmtompeg.html +--- old/userguide/ppmtompeg.html 2017-09-05 14:20:09.739743396 +0200 ++++ new/userguide/ppmtompeg.html 1970-01-01 01:00:00.000000000 +0100 @@ -1,1291 +0,0 @@ - - @@ -1378,7 +1075,7 @@ index 4fa4a53..0000000 -("predictive" frame) describes a movie frame by describing how it -differs from the movie frame described by the latest preceding I or -P frame. A B frame ("bidirectional" frame) describes a movie frame by --describing how it differs from the the movie frames described by the +-describing how it differs from the movie frames described by the -nearest I or P frame before and after it. - -

    Note that the first frame of a movie must be described by an I @@ -1470,7 +1167,7 @@ index 4fa4a53..0000000 - -

    You can run ppmtompeg on multiple machines at once, encoding -the same MPEG stream. When you do, the machines are used as shown in --the following diagram. We call this "parallel mode." +-the following diagram. We call this "parallel mode." - -

    ppmtompeg-par.gif - @@ -1520,8 +1217,8 @@ index 4fa4a53..0000000 -parameter file statement when you do parallel operation. - -

    The machine on which you originally invoke ppmtompeg is the --master machine. It hosts a "combine server,", a --"decode server," and a number of "i/o servers," +-master machine. It hosts a "combine server,", a +-"decode server," and a number of "i/o servers," -all as separate processes. The other machines in the network (listed -in the parameter file) are slave machines. Each hosts a single -process that continuously requests work from the master and does it. diff --git a/SOURCES/netpbm-multipage-pam.patch b/SOURCES/netpbm-multipage-pam.patch deleted file mode 100644 index 59b1651..0000000 --- a/SOURCES/netpbm-multipage-pam.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/converter/other/pnmtops.c b/converter/other/pnmtops.c -index 24dc7df..e393931 100644 ---- a/converter/other/pnmtops.c -+++ b/converter/other/pnmtops.c -@@ -1909,6 +1909,7 @@ convertPage(FILE * const ifP, - /* The file stream which is the head of the filter chain; we write to - this and filtered stuff comes out the other end. - */ -+ FILE * filterChainOfP; - - pnm_readpaminit(ifP, &inpam, PAM_STRUCT_SIZE(tuple_type)); - -@@ -1951,7 +1952,11 @@ convertPage(FILE * const ifP, - initOutputEncoder(&oe, inpam.width, bitsPerSample, - rle, flate, ascii85, psFilter); - -- spawnFilters(stdout, &oe, &feedFileP, filterPidList); -+ fflush(stdout); -+ filterChainOfP = fdopen(dup(fileno(stdout)), "w"); -+ /* spawnFilters() closes this. See FILE MANAGEMENT above */ -+ -+ spawnFilters(filterChainOfP, &oe, &feedFileP, filterPidList); - - convertRaster(&inpam, bitsPerSample, psFilter, feedFileP); - diff --git a/SOURCES/netpbm-nodoc.patch b/SOURCES/netpbm-nodoc.patch deleted file mode 100644 index 2ecf665..0000000 --- a/SOURCES/netpbm-nodoc.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- netpbm-10.24/GNUmakefile.nodoc 2004-08-11 20:41:54.000000000 +0200 -+++ netpbm-10.24/GNUmakefile 2004-09-23 16:08:29.724369240 +0200 -@@ -275,16 +275,12 @@ - endif - - .PHONY: install.manweb --install.manweb: $(PKGDIR)/man/web/netpbm.url $(PKGDIR)/bin/doc.url -+install.manweb: $(PKGDIR)/man/web/netpbm.url - - $(PKGDIR)/man/web/netpbm.url: $(PKGDIR)/man/web - echo "$(NETPBM_DOCURL)" > $@ - chmod $(INSTALL_PERM_MAN) $@ - --$(PKGDIR)/bin/doc.url: $(PKGDIR)/bin -- echo "$(NETPBM_DOCURL)" > $@ -- chmod $(INSTALL_PERM_MAN) $@ -- - .PHONY: install-dev - # Note that you might install the development package and NOT the runtime - # package. If you have a special system for building stuff, maybe for diff --git a/SOURCES/netpbm-noppmtompeg.patch b/SOURCES/netpbm-noppmtompeg.patch index 58b7fa8..2b2f2db 100644 --- a/SOURCES/netpbm-noppmtompeg.patch +++ b/SOURCES/netpbm-noppmtompeg.patch @@ -1,17 +1,6 @@ -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 -@@ -251,7 +251,6 @@ MAN1 = \ - ppmtolj.1 \ - ppmtomap.1 \ - ppmtomitsu.1 \ -- ppmtompeg.1 \ - 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 -urNp old/converter/ppm/Makefile new/converter/ppm/Makefile +--- old/converter/ppm/Makefile 2017-09-05 13:40:36.789469114 +0200 ++++ new/converter/ppm/Makefile 2017-09-05 13:42:55.974616951 +0200 @@ -7,7 +7,7 @@ VPATH=.:$(SRCDIR)/$(SUBDIR) include $(BUILDDIR)/config.mk diff --git a/SOURCES/netpbm-pgmtexture-fault.patch b/SOURCES/netpbm-pgmtexture-fault.patch deleted file mode 100644 index 78f2667..0000000 --- a/SOURCES/netpbm-pgmtexture-fault.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/analyzer/pgmtexture.c b/analyzer/pgmtexture.c -index b694219..e33bc5c 100644 ---- a/analyzer/pgmtexture.c -+++ b/analyzer/pgmtexture.c -@@ -929,7 +929,7 @@ main (int argc, const char ** argv) { - - FILE * ifP; - gray ** grays; -- unsigned int tone[PGM_MAXMAXVAL]; -+ unsigned int tone[PGM_MAXMAXVAL+1]; - unsigned int r0, r45, r90; - unsigned int d; - unsigned int x, y; diff --git a/SOURCES/netpbm-pnmtopclxl.patch b/SOURCES/netpbm-pnmtopclxl.patch deleted file mode 100644 index dc67040..0000000 --- a/SOURCES/netpbm-pnmtopclxl.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -up netpbm-10.58.01/converter/other/pnmtopclxl.c.pnmtopclxl netpbm-10.58.01/converter/other/pnmtopclxl.c ---- netpbm-10.58.01/converter/other/pnmtopclxl.c.pnmtopclxl 2012-04-09 15:31:42.000000000 +0200 -+++ netpbm-10.58.01/converter/other/pnmtopclxl.c 2012-06-13 15:39:17.566141565 +0200 -@@ -269,10 +269,10 @@ XY_RLEnew(size_t const size) { - - MALLOCVAR(rleP); - if (rleP) { -- rleP->fbuf = malloc(size); -+ rleP->fbufsize = MAX(1024, size); -+ rleP->fbuf = malloc(rleP->fbufsize); - - if (rleP->fbuf) { -- rleP->fbufsize = MAX(1024, size); - retval = rleP; - } else - retval = NULL; diff --git a/SOURCES/netpbm-pnmtops-hangs.patch b/SOURCES/netpbm-pnmtops-hangs.patch deleted file mode 100644 index 4efe6f6..0000000 --- a/SOURCES/netpbm-pnmtops-hangs.patch +++ /dev/null @@ -1,327 +0,0 @@ -diff --git a/converter/other/pnmtops.c b/converter/other/pnmtops.c -index e393931..e1f2d18 100644 ---- a/converter/other/pnmtops.c -+++ b/converter/other/pnmtops.c -@@ -42,6 +42,8 @@ - #include - #include - #include -+#include -+#include - #ifndef NOFLATE - #include - #endif -@@ -52,6 +54,37 @@ - #include "shhopt.h" - #include "nstring.h" - -+ -+ -+static void -+setSignals() { -+/*---------------------------------------------------------------------------- -+ Set up the process-global signal-related state. -+ -+ Note that we can't rely on defaults, because much of this is inherited -+ from the process that forked and exec'ed this program. -+-----------------------------------------------------------------------------*/ -+ /* See waitForChildren() for why we do this to SIGCHLD */ -+ -+ struct sigaction sigchldAction; -+ int rc; -+ sigset_t emptySet; -+ -+ sigemptyset(&emptySet); -+ -+ sigchldAction.sa_handler = SIG_DFL; -+ sigchldAction.sa_mask = emptySet; -+ sigchldAction.sa_flags = SA_NOCLDSTOP; -+ -+ rc = sigaction(SIGCHLD, &sigchldAction, NULL); -+ -+ if (rc != 0) -+ pm_error("sigaction() to set up signal environment failed, " -+ "errno = %d (%s)", errno, strerror(errno)); -+} -+ -+ -+ - struct cmdlineInfo { - /* All the information the user supplied in the command line, - in a form easy for the program to use. -@@ -256,21 +289,17 @@ parseCommandLine(int argc, const char ** argv, - validateCompDimension(width, 72, "-width value"); - validateCompDimension(height, 72, "-height value"); - -- overflow2(width, 72); - cmdlineP->width = width * 72; -- overflow2(height, 72); - cmdlineP->height = height * 72; - - if (imagewidthSpec) { - validateCompDimension(imagewidth, 72, "-imagewidth value"); -- overflow2(imagewidth, 72); - cmdlineP->imagewidth = imagewidth * 72; - } - else - cmdlineP->imagewidth = 0; - if (imageheightSpec) { -- validateCompDimension(imageheight, 72, "-imageheight value"); -- overflow2(imageheight, 72); -+ validateCompDimension(imagewidth, 72, "-imageheight value"); - cmdlineP->imageheight = imageheight * 72; - } - else -@@ -339,6 +368,33 @@ basebasename(const char * const filespec) { - - - -+static void -+writeFile(const unsigned char * const buffer, -+ size_t const writeCt, -+ const char * const name, -+ FILE * const ofP) { -+ -+ size_t writtenCt; -+ -+ writtenCt = fwrite(buffer, 1, writeCt, ofP); -+ -+ if (writtenCt != writeCt) -+ pm_error("Error writing to %s output file", name); -+} -+ -+ -+ -+static void -+writeFileChar(const char * const buffer, -+ size_t const writeCt, -+ const char * const name, -+ FILE * const ofP) { -+ -+ writeFile((const unsigned char *)buffer, writeCt, name, ofP); -+} -+ -+ -+ - #define MAX_FILTER_CT 10 - /* The maximum number of filters this code is capable of applying */ - -@@ -498,18 +554,12 @@ flateFilter(FILE * const ifP, - */ - do { - unsigned int have; -- size_t bytesWritten; - - strm.avail_out = chunkSz; - strm.next_out = out; - deflate(&strm, flush); - have = chunkSz - strm.avail_out; -- bytesWritten = fwrite(out, 1, have, ofP); -- if (ferror(ofP) || bytesWritten != have) { -- deflateEnd(&strm); -- pm_error("Error writing to internal pipe during " -- "flate compression."); -- } -+ writeFile(out, have, "flate filter", ofP); - } while (strm.avail_out == 0); - assert(strm.avail_in == 0); /* all input is used */ - -@@ -554,7 +604,7 @@ rlePutBuffer (unsigned int const repeat, - fputc(repeatitem, fP); - } else { - fputc(count - 1, fP); -- fwrite(itembuf, 1, count, fP); -+ writeFile(itembuf, count, "rlePutBuffer", fP); - } - } - -@@ -677,23 +727,24 @@ asciiHexFilter(FILE * const ifP, - unsigned char inbuff[40], outbuff[81]; - - for (eof = false; !eof; ) { -- size_t bytesRead; -+ size_t readCt; - -- bytesRead = fread(inbuff, 1, 40, ifP); -+ readCt = fread(inbuff, 1, 40, ifP); - -- if (bytesRead == 0) -+ if (readCt == 0) - eof = true; - else { - unsigned int i; - -- for (i = 0; i < bytesRead; ++i) { -+ for (i = 0; i < readCt; ++i) { - int const item = inbuff[i]; - outbuff[i*2] = hexits[item >> 4]; - outbuff[i*2+1] = hexits[item & 15]; - } - } -- outbuff[bytesRead * 2] = '\n'; -- fwrite(outbuff, 1, bytesRead*2 + 1, ofP); -+ outbuff[readCt * 2] = '\n'; -+ -+ writeFile(outbuff, readCt * 2 + 1, "asciiHex filter", ofP); - } - - fclose(ifP); -@@ -731,7 +782,8 @@ ascii85Filter(FILE * const ifP, - ++count; - - if (value == 0 && count == 4) { -- putchar('z'); /* Ascii85 encoding z exception */ -+ writeFileChar("z", 1, "ASCII 85 filter", ofP); -+ /* Ascii85 encoding z exception */ - ++outcount; - count = 0; - } else if (count == 4) { -@@ -741,13 +793,14 @@ ascii85Filter(FILE * const ifP, - outbuff[1] = value % 85 + 33; - outbuff[0] = value / 85 + 33; - -- fwrite(outbuff, 1, count + 1, ofP); -+ writeFileChar(outbuff, count + 1, "ASCII 85 filter", ofP); -+ - count = value = 0; - outcount += 5; - } - - if (outcount > 75) { -- putchar('\n'); -+ writeFileChar("\n", 1, "ASCII 85 filter", ofP); - outcount = 0; - } - } -@@ -763,7 +816,7 @@ ascii85Filter(FILE * const ifP, - outbuff[0] = value / 85 + 33; - outbuff[count + 1] = '\n'; - -- fwrite(outbuff, 1, count + 2, ofP); -+ writeFileChar(outbuff, count + 2, "ASCII 85 filter", ofP); - } - - fclose(ifP); -@@ -873,13 +926,22 @@ addFilter(const char * const description, - OutputEncoder * const oeP, - FILE ** const feedFilePP, - pid_t * const pidList) { -+/*---------------------------------------------------------------------------- -+ Add a filter to the front of the chain. - -- pid_t pid; -+ Spawn a process to do the filtering, by running function 'filter'. -+ -+ *feedFilePP is the present head of the chain. We make the new filter -+ process write its output to that and get its input from a new pipe. -+ We update *feedFilePP to the sending end of the new pipe. - -+ Add to the list pidList[] the PID of the process we spawn. -+-----------------------------------------------------------------------------*/ - FILE * const oldFeedFileP = *feedFilePP; - - FILE * newFeedFileP; -- -+ pid_t pid; -+ - spawnFilter(oldFeedFileP, filter, oeP, &newFeedFileP, &pid); - - if (verbose) -@@ -887,7 +949,7 @@ addFilter(const char * const description, - description, (unsigned)pid); - - fclose(oldFeedFileP); /* Child keeps this open now */ -- -+ - addToPidList(pidList, pid); - - *feedFilePP = newFeedFileP; -@@ -949,6 +1011,15 @@ waitForChildren(const pid_t * const pidList) { - Wait for all child processes with PIDs in pidList[] to exit. - In pidList[], end-of-list is marked with a special zero value. - -----------------------------------------------------------------------------*/ -+ /* There's an odd behavior in Unix such that if you have set the -+ action for SIGCHLD to ignore the signal (even though ignoring the -+ signal is the default), the process' children do not become -+ zombies. Consequently, waitpid() always fails with ECHILD - but -+ nonetheless waits for the child to exit. -+ -+ We expect the process not to have the action for SIGCHLD set that -+ way. -+ */ - unsigned int i; - - for (i = 0; pidList[i]; ++i) { -@@ -960,7 +1031,8 @@ waitForChildren(const pid_t * const pidList) { - - rc = waitpid(pidList[i], &status, 0); - if (rc == -1) -- pm_error ("waitpid() for child %u failed", i); -+ pm_error ("waitpid() for child %u failed, errno=%d (%s)", -+ i, errno, strerror(errno)); - else if (status != EXIT_SUCCESS) - pm_error ("Child process %u terminated abnormally", i); - } -@@ -1724,7 +1796,7 @@ convertRowPbm(struct pam * const pamP, - bitrow[colChars-1] <<= padRight; /* right edge */ - } - -- fwrite(bitrow, 1, colChars, fP); -+ writeFile(bitrow, colChars, "PBM reader", fP); - } - - -@@ -1867,6 +1939,21 @@ convertRaster(struct pam * const inpamP, - - - -+/* FILE MANAGEMENT: File management is pretty hairy here. A filter, which -+ runs in its own process, needs to be able to cause its output file to -+ close because it might be an internal pipe and the next stage needs to -+ know output is done. So the forking process must close its copy of the -+ file descriptor. BUT: if the output of the filter is not an internal -+ pipe but this program's output, then we don't want it closed when the -+ filter terminates because we'll need it to be open for the next image -+ the program converts (with a whole new chain of filters). -+ -+ To prevent the progam output file from getting closed, we pass a -+ duplicate of it to spawnFilters() and keep the original open. -+*/ -+ -+ -+ - static void - convertPage(FILE * const ifP, - int const turnflag, -@@ -1954,7 +2041,7 @@ convertPage(FILE * const ifP, - - fflush(stdout); - filterChainOfP = fdopen(dup(fileno(stdout)), "w"); -- /* spawnFilters() closes this. See FILE MANAGEMENT above */ -+ /* spawnFilters() closes this. See FILE MANAGEMENT above */ - - spawnFilters(filterChainOfP, &oe, &feedFileP, filterPidList); - -@@ -1979,6 +2066,8 @@ main(int argc, const char * argv[]) { - - pm_proginit(&argc, argv); - -+ setSignals(); -+ - parseCommandLine(argc, argv, &cmdline); - - verbose = cmdline.verbose; -@@ -1994,6 +2083,13 @@ main(int argc, const char * argv[]) { - name = strdup("noname"); - else - name = basebasename(cmdline.inputFileName); -+ -+ /* This program manages file descriptors in a way that assumes -+ that new files will get file descriptor numbers less than 10, -+ so we close superfluous files now to make sure that's true. -+ */ -+ closeAllBut(fileno(ifP), fileno(stdout), fileno(stderr)); -+ - { - int eof; /* There are no more images in the input file */ - unsigned int imageSeq; diff --git a/SOURCES/netpbm-ppmfadeusage.patch b/SOURCES/netpbm-ppmfadeusage.patch index 88ad44c..d48f5f5 100644 --- a/SOURCES/netpbm-ppmfadeusage.patch +++ b/SOURCES/netpbm-ppmfadeusage.patch @@ -1,15 +1,7 @@ -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 - my $image = "ppm"; # default output storage format - my $mode = $SPREAD; # default fading mode - -- - my $n; # argument number - - for ($n = 0; $n < @ARGV; $n++) { -@@ -44,7 +43,7 @@ for ($n = 0; $n < @ARGV; $n++) { +diff -urNp old/editor/ppmfade new/editor/ppmfade +--- old/editor/ppmfade 2017-11-01 11:47:49.869611402 +0100 ++++ new/editor/ppmfade 2017-11-01 11:53:25.524973342 +0100 +@@ -84,7 +84,7 @@ for ($n = 0; $n < @ARGV; $n++) { if (-e $first_file) { } else { print "I can't find first file '$first_file'\n"; @@ -18,7 +10,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++) { +@@ -92,7 +92,7 @@ for ($n = 0; $n < @ARGV; $n++) { if (-e $last_file) { } else { print "I can't find last file '$last_file'\n"; @@ -27,12 +19,10 @@ 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++) { +@@ -113,9 +113,12 @@ for ($n = 0; $n < @ARGV; $n++) { $mode = $BLOCK; } elsif ("$ARGV[$n]" eq "-mix") { $mode = $MIX; -- } elsif ($ARGV[$n] eq "-help" || $ARGV[$n] eq "-h") { -- usage(); + } elsif ($ARGV[$n] eq "-help" || $ARGV[$n] eq "--help" || $ARGV[$n] eq "-h") { + print "ppmfade: Use 'man ppmfade' for help.\n"; + exit 1; @@ -43,7 +33,7 @@ diff -up netpbm-10.47.09/editor/ppmfade.ppmfadeusage netpbm-10.47.09/editor/ppmf } } # -@@ -96,18 +96,18 @@ if ($first_file ne "undefined") { +@@ -134,18 +137,18 @@ if ($first_file ne "undefined") { $width = $1; $height = $2; } else { print("Unrecognized results from pnmfile on $first_file.\n"); diff --git a/SOURCES/netpbm-ppmtopict.patch b/SOURCES/netpbm-ppmtopict.patch deleted file mode 100644 index 97b7d2b..0000000 --- a/SOURCES/netpbm-ppmtopict.patch +++ /dev/null @@ -1,12 +0,0 @@ -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) { - -- unsigned int i; -+ int i; - unsigned int count; - unsigned int run; - unsigned int rep; diff --git a/SOURCES/netpbm-security-code.patch b/SOURCES/netpbm-security-code.patch index 27b49fb..9d286c8 100644 --- a/SOURCES/netpbm-security-code.patch +++ b/SOURCES/netpbm-security-code.patch @@ -1,6 +1,6 @@ -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 +diff -urNp old/analyzer/pgmtexture.c new/analyzer/pgmtexture.c +--- old/analyzer/pgmtexture.c 2017-09-05 15:09:00.975207528 +0200 ++++ new/analyzer/pgmtexture.c 2017-09-05 15:11:44.193390835 +0200 @@ -97,7 +97,7 @@ vector(unsigned int const nl, float * v; @@ -18,18 +18,17 @@ 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 +138,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 -urNp old/converter/other/gemtopnm.c new/converter/other/gemtopnm.c +--- old/converter/other/gemtopnm.c 2017-09-05 15:09:00.990207453 +0200 ++++ new/converter/other/gemtopnm.c 2017-09-05 15:12:20.786208419 +0200 @@ -106,6 +106,7 @@ main(argc, argv) pnm_writepnminit( stdout, cols, rows, MAXVAL, type, 0 ); @@ -38,10 +37,10 @@ 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 -urNp old/converter/other/jpegtopnm.c new/converter/other/jpegtopnm.c +--- old/converter/other/jpegtopnm.c 2017-09-05 15:09:00.993207438 +0200 ++++ new/converter/other/jpegtopnm.c 2017-09-05 15:13:02.322001620 +0200 +@@ -862,6 +862,8 @@ convertImage(FILE * /* Calculate output image dimensions so we can allocate space */ jpeg_calc_output_dimensions(cinfoP); @@ -50,9 +49,9 @@ 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 -urNp old/converter/other/pbmtopgm.c new/converter/other/pbmtopgm.c +--- old/converter/other/pbmtopgm.c 2017-09-05 15:09:00.991207448 +0200 ++++ new/converter/other/pbmtopgm.c 2017-09-05 15:13:32.640850830 +0200 @@ -47,6 +47,7 @@ main(int argc, char *argv[]) { "than the image height (%u rows)", height, rows); @@ -61,10 +60,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 -@@ -632,6 +632,7 @@ main(int argc, char *argv[]) { +diff -urNp old/converter/other/pnmtoddif.c new/converter/other/pnmtoddif.c +--- old/converter/other/pnmtoddif.c 2017-09-05 15:09:00.991207448 +0200 ++++ new/converter/other/pnmtoddif.c 2017-09-05 15:14:34.400564239 +0200 +@@ -629,6 +629,7 @@ main(int argc, char *argv[]) { switch (PNM_FORMAT_TYPE(format)) { case PBM_TYPE: ip.bits_per_pixel = 1; @@ -72,31 +71,31 @@ diff -up netpbm-10.58.01/converter/other/pnmtoddif.c.security-code netpbm-10.58. ip.bytes_per_line = (cols + 7) / 8; ip.spectral = 2; ip.components = 1; -@@ -647,6 +648,7 @@ main(int argc, char *argv[]) { +@@ -644,6 +645,7 @@ main(int argc, char *argv[]) { ip.polarity = 2; break; case PPM_TYPE: -+ overflow2(cols, 3); ++ overflow2(cols, 3); 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 -urNp old/converter/other/pnmtojpeg.c new/converter/other/pnmtojpeg.c +--- old/converter/other/pnmtojpeg.c 2017-09-05 15:09:00.992207443 +0200 ++++ new/converter/other/pnmtojpeg.c 2017-09-05 15:16:52.065875364 +0200 +@@ -606,7 +606,11 @@ read_scan_script(j_compress_ptr const ci want JPOOL_PERMANENT. */ const unsigned int scan_info_size = nscans * sizeof(jpeg_scan_info); - jpeg_scan_info * const scan_info = + const jpeg_scan_info * scan_info; -+ ++ + overflow2(nscans, sizeof(jpeg_scan_info)); -+ -+ scan_info = ++ ++ scan_info = (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 +@@ -938,6 +942,8 @@ compute_rescaling_array(JSAMPLE ** const const long half_maxval = maxval / 2; long val; @@ -105,7 +104,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 +@@ -1016,6 +1022,7 @@ convert_scanlines(struct jpeg_compress_s */ /* Allocate the libpnm output and compressor input buffers */ @@ -113,21 +112,23 @@ 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 -urNp old/converter/other/pnmtops.c new/converter/other/pnmtops.c +--- old/converter/other/pnmtops.c 2017-09-05 15:09:00.993207438 +0200 ++++ new/converter/other/pnmtops.c 2017-09-05 15:18:52.602038826 +0200 +@@ -293,18 +293,22 @@ parseCommandLine(int argc, const char ** + validateCompDimension(width, 72, "-width value"); validateCompDimension(height, 72, "-height value"); - -+ overflow2(width, 72); +- ++ ++ overflow2(width, 72); cmdlineP->width = width * 72; + overflow2(height, 72); cmdlineP->height = height * 72; if (imagewidthSpec) { validateCompDimension(imagewidth, 72, "-imagewidth value"); -+ overflow2(imagewidth, 72); ++ overflow2(imagewidth, 72); cmdlineP->imagewidth = imagewidth * 72; } else @@ -135,65 +136,65 @@ diff -up netpbm-10.58.01/converter/other/pnmtops.c.security-code netpbm-10.58.01 if (imageheightSpec) { - validateCompDimension(imagewidth, 72, "-imageheight value"); + validateCompDimension(imageheight, 72, "-imageheight value"); -+ overflow2(imageheight, 72); ++ overflow2(imageheight, 72); cmdlineP->imageheight = imageheight * 72; } else -diff -up netpbm-10.58.01/converter/other/pnmtorle.c.security-code netpbm-10.58.01/converter/other/pnmtorle.c ---- netpbm-10.58.01/converter/other/pnmtorle.c.security-code 2012-04-09 15:31:42.000000000 +0200 -+++ netpbm-10.58.01/converter/other/pnmtorle.c 2012-04-09 15:40:03.188619976 +0200 +diff -urNp old/converter/other/pnmtorle.c new/converter/other/pnmtorle.c +--- old/converter/other/pnmtorle.c 2017-09-05 15:09:00.993207438 +0200 ++++ new/converter/other/pnmtorle.c 2017-09-05 15:19:42.218061079 +0200 @@ -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 ++ * 2002-12-19: Fix maths wrapping bugs. Alan Cox */ /* * pnmtorle - A program which will convert pbmplus (ppm or pgm) images -diff -up netpbm-10.58.01/converter/other/pnmtosgi.c.security-code netpbm-10.58.01/converter/other/pnmtosgi.c ---- netpbm-10.58.01/converter/other/pnmtosgi.c.security-code 2012-04-09 15:31:42.000000000 +0200 -+++ netpbm-10.58.01/converter/other/pnmtosgi.c 2012-04-09 15:40:03.188619976 +0200 -@@ -254,6 +254,7 @@ build_channels(FILE * const ifp, int con - #endif +diff -urNp old/converter/other/pnmtosgi.c new/converter/other/pnmtosgi.c +--- old/converter/other/pnmtosgi.c 2017-09-05 15:09:00.992207443 +0200 ++++ new/converter/other/pnmtosgi.c 2017-09-05 15:23:54.121864563 +0200 +@@ -139,6 +139,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 len; + size_t lenBytes; +@@ -185,6 +187,7 @@ buildChannels(FILE * const ifP, + ScanElem * temp; - if( storage != STORAGE_VERBATIM ) { + if (storage != STORAGE_VERBATIM) { + overflow2(channels, rows); MALLOCARRAY_NOFAIL(table, channels * rows); - MALLOCARRAY_NOFAIL(rletemp, WORSTCOMPR(cols)); - } -@@ -306,6 +307,8 @@ compress(ScanElem * temp, - break; - case STORAGE_RLE: - tabrow = chan_no * rows + row; -+ overflow2(chan_no, rows); -+ overflow_add(chan_no* rows, row); - len = rle_compress(temp, cols); /* writes result into rletemp */ - channel[chan_no][row].length = len; - MALLOCARRAY(p, len); -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 + } else + table = NULL; +diff -urNp old/converter/other/rletopnm.c new/converter/other/rletopnm.c +--- old/converter/other/rletopnm.c 2017-09-05 15:09:00.991207448 +0200 ++++ new/converter/other/rletopnm.c 2017-09-05 15:24:29.441803825 +0200 @@ -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 ++ * 2002-12-19: Fix maths wrapping bugs. Alan Cox */ /* * rletopnm - A conversion program to convert from Utah's "rle" image format -diff -up netpbm-10.58.01/converter/other/sgitopnm.c.security-code netpbm-10.58.01/converter/other/sgitopnm.c ---- netpbm-10.58.01/converter/other/sgitopnm.c.security-code 2012-04-09 15:31:42.000000000 +0200 -+++ netpbm-10.58.01/converter/other/sgitopnm.c 2012-04-09 15:40:03.189619963 +0200 -@@ -359,10 +359,14 @@ readChannels(FILE * const ifP, +diff -urNp old/converter/other/sgitopnm.c new/converter/other/sgitopnm.c +--- old/converter/other/sgitopnm.c 2017-09-05 15:09:00.991207448 +0200 ++++ new/converter/other/sgitopnm.c 2017-09-05 15:26:59.320478129 +0200 +@@ -377,10 +377,14 @@ readChannels(FILE * const ifP, MALLOCARRAY_NOFAIL(image, head->ysize); } else { - maxchannel = MIN(3, head->zsize); + maxchannel = 3; + overflow2(head->ysize, maxchannel); MALLOCARRAY_NOFAIL(image, head->ysize * maxchannel); } -- if (table) +- if (table) + if (table) { + overflow2(head->xsize, 2); + overflow_add(head->xsize*2, 2); @@ -202,21 +203,21 @@ diff -up netpbm-10.58.01/converter/other/sgitopnm.c.security-code netpbm-10.58.0 for (channel = 0; channel < maxchannel; ++channel) { unsigned int row; -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 -urNp old/converter/other/sirtopnm.c new/converter/other/sirtopnm.c +--- old/converter/other/sirtopnm.c 2017-09-05 15:09:00.993207438 +0200 ++++ new/converter/other/sirtopnm.c 2017-09-05 15:27:29.784400243 +0200 @@ -69,6 +69,7 @@ char* argv[]; } break; case PPM_TYPE: -+ overflow3(cols, rows, 3); ++ overflow3(cols, rows, 3); 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 -urNp old/converter/other/tifftopnm.c new/converter/other/tifftopnm.c +--- old/converter/other/tifftopnm.c 2017-09-05 15:09:00.991207448 +0200 ++++ new/converter/other/tifftopnm.c 2017-09-05 15:29:34.649047220 +0200 +@@ -1372,7 +1372,9 @@ convertRasterByRows(pnmOut * const if (scanbuf == NULL) pm_error("can't allocate memory for scanline buffer"); @@ -227,10 +228,10 @@ 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 -urNp old/converter/other/xwdtopnm.c new/converter/other/xwdtopnm.c +--- old/converter/other/xwdtopnm.c 2017-09-05 15:09:00.994207433 +0200 ++++ new/converter/other/xwdtopnm.c 2017-09-05 15:30:51.608806353 +0200 +@@ -210,6 +210,10 @@ processX10Header(X10WDFileHeader * cons *colorsP = pnm_allocrow(2); PNM_ASSIGN1((*colorsP)[0], 0); PNM_ASSIGN1((*colorsP)[1], *maxvalP); @@ -241,7 +242,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 +@@ -635,6 +639,7 @@ processX11Header(X11WDFileHeader * cons *colsP = h11FixedP->pixmap_width; *rowsP = h11FixedP->pixmap_height; @@ -249,9 +250,9 @@ 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 -urNp old/converter/pbm/mdatopbm.c new/converter/pbm/mdatopbm.c +--- old/converter/pbm/mdatopbm.c 2017-09-05 15:09:00.988207463 +0200 ++++ new/converter/pbm/mdatopbm.c 2017-09-05 15:31:47.007612804 +0200 @@ -245,10 +245,13 @@ main(int argc, char **argv) { pm_readlittleshort(infile, &yy); nInCols = yy; } @@ -267,9 +268,9 @@ 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 -urNp old/converter/pbm/mgrtopbm.c new/converter/pbm/mgrtopbm.c +--- old/converter/pbm/mgrtopbm.c 2017-09-05 15:09:00.988207463 +0200 ++++ new/converter/pbm/mgrtopbm.c 2017-09-05 15:32:29.335457328 +0200 @@ -65,6 +65,8 @@ readMgrHeader(FILE * const ifP, if (head.h_high < ' ' || head.l_high < ' ') pm_error("Invalid width field in MGR header"); @@ -279,9 +280,9 @@ 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 +diff -urNp old/converter/pbm/pbmtogem.c new/converter/pbm/pbmtogem.c +--- old/converter/pbm/pbmtogem.c 2017-09-05 15:09:00.988207463 +0200 ++++ new/converter/pbm/pbmtogem.c 2017-09-05 15:33:20.015266347 +0200 @@ -79,6 +79,7 @@ putinit (int const rows, int const cols) bitsperitem = 0; bitshift = 7; @@ -290,9 +291,9 @@ diff -up netpbm-10.58.01/converter/pbm/pbmtogem.c.security-code netpbm-10.58.01/ 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 +diff -urNp old/converter/pbm/pbmtogo.c new/converter/pbm/pbmtogo.c +--- old/converter/pbm/pbmtogo.c 2017-09-05 15:09:00.988207463 +0200 ++++ new/converter/pbm/pbmtogo.c 2017-09-05 15:33:44.200173491 +0200 @@ -158,6 +158,7 @@ main(int argc, bitrow = pbm_allocrow(cols); @@ -301,9 +302,9 @@ diff -up netpbm-10.58.01/converter/pbm/pbmtogo.c.security-code netpbm-10.58.01/c 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 +diff -urNp old/converter/pbm/pbmtolj.c new/converter/pbm/pbmtolj.c +--- old/converter/pbm/pbmtolj.c 2017-09-05 15:09:00.987207468 +0200 ++++ new/converter/pbm/pbmtolj.c 2017-09-05 15:34:35.767972087 +0200 @@ -120,7 +120,11 @@ parseCommandLine(int argc, char ** argv, static void allocateBuffers(unsigned int const cols) { @@ -316,41 +317,22 @@ diff -up netpbm-10.58.01/converter/pbm/pbmtolj.c.security-code netpbm-10.58.01/c 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) +diff -urNp old/converter/pbm/pbmtomda.c new/converter/pbm/pbmtomda.c +--- old/converter/pbm/pbmtomda.c 2017-09-05 15:09:00.987207468 +0200 ++++ new/converter/pbm/pbmtomda.c 2017-09-05 15:47:39.279563827 +0200 +@@ -179,6 +179,8 @@ 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 +diff -urNp old/converter/pbm/pbmtoppa/pbm.c new/converter/pbm/pbmtoppa/pbm.c +--- old/converter/pbm/pbmtoppa/pbm.c 2017-09-05 15:09:00.990207453 +0200 ++++ new/converter/pbm/pbmtoppa/pbm.c 2017-09-05 15:49:13.364155211 +0200 +@@ -106,6 +106,7 @@ int pbm_readline(pbm_stat* pbm,unsigned return 0; case P4: @@ -358,7 +340,7 @@ diff -up netpbm-10.58.01/converter/pbm/pbmtoppa/pbm.c.security-code netpbm-10.58 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 +@@ -130,7 +131,8 @@ void pbm_unreadline (pbm_stat *pbm, void return; pbm->unread = 1; @@ -368,10 +350,10 @@ diff -up netpbm-10.58.01/converter/pbm/pbmtoppa/pbm.c.security-code netpbm-10.58 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[]) { +diff -urNp old/converter/pbm/pbmtoppa/pbmtoppa.c new/converter/pbm/pbmtoppa/pbmtoppa.c +--- old/converter/pbm/pbmtoppa/pbmtoppa.c 2017-09-05 15:09:00.990207453 +0200 ++++ new/converter/pbm/pbmtoppa/pbmtoppa.c 2017-09-05 15:50:10.811968059 +0200 +@@ -453,6 +453,7 @@ main(int argc, char *argv[]) { pm_error("main(): unrecognized parameter '%s'", argv[argn]); } @@ -379,64 +361,22 @@ diff -up netpbm-10.58.01/converter/pbm/pbmtoppa/pbmtoppa.c.security-code netpbm- 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, - +diff -urNp old/converter/pbm/pbmtoxbm.c new/converter/pbm/pbmtoxbm.c +--- old/converter/pbm/pbmtoxbm.c 2017-09-05 15:09:00.987207468 +0200 ++++ new/converter/pbm/pbmtoxbm.c 2017-09-05 15:51:01.843793892 +0200 +@@ -353,6 +353,8 @@ convertRaster(FILE * const ifP, unsigned char * bitrow; unsigned int row; -+ -+ overflow_add(cols, padright); ++ 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 -@@ -2,6 +2,7 @@ - - #include "nstring.h" - #include "pbm.h" -+#include - - static char bit_table[2][3] = { - {1, 4, 0x10}, -@@ -160,7 +161,7 @@ main(int argc, char * argv[]) { + bitrow = pbm_allocrow_packed(cols + padright); +diff -urNp old/converter/pbm/pbmto4425.c new/converter/pbm/pbmto4425.c +--- old/converter/pbm/pbmto4425.c 2017-09-05 15:09:00.988207463 +0200 ++++ new/converter/pbm/pbmto4425.c 2017-09-05 15:54:37.077992604 +0200 +@@ -160,7 +160,7 @@ main(int argc, char * argv[]) { xres = vmap_width * 2; yres = vmap_height * 3; @@ -445,10 +385,10 @@ 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 -urNp old/converter/pbm/pktopbm.c new/converter/pbm/pktopbm.c +--- old/converter/pbm/pktopbm.c 2017-09-05 15:09:00.988207463 +0200 ++++ new/converter/pbm/pktopbm.c 2017-09-05 15:55:35.736759083 +0200 +@@ -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 */ @@ -456,42 +396,30 @@ 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 -urNp old/converter/pbm/thinkjettopbm.l new/converter/pbm/thinkjettopbm.l +--- old/converter/pbm/thinkjettopbm.l 2017-09-05 15:09:00.988207463 +0200 ++++ new/converter/pbm/thinkjettopbm.l 2017-09-05 15:57:03.449400388 +0200 @@ -114,7 +114,9 @@ DIG [0-9] \033\*b{DIG}+W { int l; if (rowCount >= rowCapacity) { -+ overflow_add(rowCapacity, 100); ++ overflow_add(rowCapacity, 100); rowCapacity += 100; -+ overflow2(rowCapacity, sizeof *rows); ++ overflow2(rowCapacity, sizeof *rows); rows = realloc (rows, rowCapacity * sizeof *rows); if (rows == NULL) pm_error ("Out of memory."); -@@ -226,6 +228,8 @@ yywrap (void) +@@ -226,6 +228,7 @@ yywrap (void) /* * Quite simple since ThinkJet bit arrangement matches PBM */ -+ + overflow2(maxRowLength, 8); 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, - 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 -urNp old/converter/pgm/lispmtopgm.c new/converter/pgm/lispmtopgm.c +--- old/converter/pgm/lispmtopgm.c 2017-09-05 15:09:01.002207393 +0200 ++++ new/converter/pgm/lispmtopgm.c 2017-09-05 15:59:07.145878261 +0200 @@ -58,6 +58,7 @@ main( argc, argv ) pm_error( "depth (%d bits) is too large", depth); @@ -507,13 +435,13 @@ diff -up netpbm-10.58.01/converter/pgm/lispmtopgm.c.security-code netpbm-10.58.0 - + + 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 -urNp old/converter/pgm/psidtopgm.c new/converter/pgm/psidtopgm.c +--- old/converter/pgm/psidtopgm.c 2017-09-05 15:09:01.002207393 +0200 ++++ new/converter/pgm/psidtopgm.c 2017-09-05 15:59:42.457726237 +0200 @@ -78,6 +78,7 @@ main(int argc, pm_error("bits/sample (%d) is too large.", bitspersample); @@ -522,10 +450,10 @@ 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 -urNp old/converter/ppm/ilbmtoppm.c new/converter/ppm/ilbmtoppm.c +--- old/converter/ppm/ilbmtoppm.c 2017-09-05 15:09:01.003207388 +0200 ++++ new/converter/ppm/ilbmtoppm.c 2017-09-05 16:04:33.011437671 +0200 +@@ -606,6 +606,7 @@ decode_row(FILE * const ifP, rawtype *chp; cols = bmhdP->w; @@ -533,7 +461,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 ****************************************************************************/ @@ -557,17 +485,17 @@ 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)); + overflow_add(redmaxval, 1); + overflow_add(greenmaxval, 1); -+ overflow_add(bluemaxval, 1); ++ overflow_add(bluemaxval, 1); 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, data ChangeCount32 = *data++; datasize -= 2; @@ -577,7 +505,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; @@ -587,17 +515,17 @@ 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 -urNp old/converter/ppm/imgtoppm.c new/converter/ppm/imgtoppm.c +--- old/converter/ppm/imgtoppm.c 2017-09-05 15:09:01.003207388 +0200 ++++ new/converter/ppm/imgtoppm.c 2017-09-06 09:21:05.977198159 +0200 @@ -84,6 +84,7 @@ main(int argc, char ** argv) { len = atoi((char*) buf ); if ( fread( buf, len, 1, ifp ) != 1 ) @@ -614,10 +542,10 @@ 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 +diff -urNp old/converter/ppm/Makefile new/converter/ppm/Makefile +--- old/converter/ppm/Makefile 2017-09-05 15:09:01.004207383 +0200 ++++ new/converter/ppm/Makefile 2017-09-06 09:21:56.848867561 +0200 +@@ -11,7 +11,7 @@ SUBDIRS = hpcdtoppm PORTBINARIES = 411toppm eyuvtoppm gouldtoppm ilbmtoppm imgtoppm \ leaftoppm mtvtoppm neotoppm \ @@ -626,9 +554,9 @@ diff -up netpbm-10.58.01/converter/ppm/Makefile.security-code netpbm-10.58.01/co 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 +diff -urNp old/converter/ppm/pcxtoppm.c new/converter/ppm/pcxtoppm.c +--- old/converter/ppm/pcxtoppm.c 2017-09-05 15:09:01.004207383 +0200 ++++ new/converter/ppm/pcxtoppm.c 2017-09-06 09:33:20.821565782 +0200 @@ -409,6 +409,7 @@ pcx_planes_to_pixels(pixels, bitplanes, /* * clear the pixel buffer @@ -645,18 +573,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 @@ -+#error "Unfixable. Don't ship me" -+ - /* +diff -urNp old/converter/ppm/picttoppm.c new/converter/ppm/picttoppm.c +--- old/converter/ppm/picttoppm.c 2017-09-05 15:09:01.003207388 +0200 ++++ new/converter/ppm/picttoppm.c 2017-09-06 09:35:38.693912426 +0200 +@@ -1,4 +1,6 @@ +-/* ++/* !!!WARNING!!! -> 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 + * Copyright 1989,1992,1993 George Phillips +diff -urNp old/converter/ppm/pjtoppm.c new/converter/ppm/pjtoppm.c +--- old/converter/ppm/pjtoppm.c 2017-09-05 15:09:01.003207388 +0200 ++++ new/converter/ppm/pjtoppm.c 2017-09-06 09:39:54.747634431 +0200 @@ -127,19 +127,21 @@ main(argc, argv) case 'V': /* send plane */ case 'W': /* send last plane */ @@ -671,14 +601,14 @@ diff -up netpbm-10.58.01/converter/ppm/pjtoppm.c.security-code netpbm-10.58.01/c - MALLOCARRAY(imlen, rows * planes); + image = (unsigned char **) + malloc3(rows , planes , sizeof(unsigned char *)); -+ imlen = (int *) malloc3(rows , planes, sizeof(int)); ++ imlen = (int *) malloc3(rows , planes, sizeof(int)); } else { + overflow2(rows,planes); image = (unsigned char **) - realloc(image, - rows * planes * -+ realloc2(image, rows * planes, ++ realloc2(image, rows * planes, sizeof(unsigned char *)); - imlen = (int *) - realloc(imlen, rows * planes * sizeof(int)); @@ -691,7 +621,7 @@ diff -up netpbm-10.58.01/converter/ppm/pjtoppm.c.security-code netpbm-10.58.01/c for (cmd = image[p + r * planes][c], val = image[p + r * planes][c+1]; - cmd >= 0 && i < newcols; cmd--, i++) -+ cmd >= 0 && i < newcols; cmd--, i++) { ++ cmd >= 0 && i < newcols; cmd--, i++) { buf[i] = val; + overflow_add(i, 1); + } @@ -706,9 +636,9 @@ 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 +diff -urNp old/converter/ppm/ppmtoeyuv.c new/converter/ppm/ppmtoeyuv.c +--- old/converter/ppm/ppmtoeyuv.c 2017-09-05 15:09:01.003207388 +0200 ++++ new/converter/ppm/ppmtoeyuv.c 2017-09-06 09:40:38.859425818 +0200 @@ -114,6 +114,7 @@ create_multiplication_tables(const pixva int index; @@ -717,22 +647,18 @@ 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"); @@ -841,22 +757,22 @@ diff -up netpbm-10.58.01/converter/ppm/ppmtopjxl.c.security-code netpbm-10.58.01 /* Figure out the colormap. */ pm_message("Computing colormap..."); -@@ -296,6 +298,8 @@ main(int argc, const char * argv[]) { +@@ -286,6 +288,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[]) { +@@ -295,9 +299,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 */ } } @@ -864,9 +780,9 @@ 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 -urNp old/converter/ppm/ppmtowinicon.c new/converter/ppm/ppmtowinicon.c +--- old/converter/ppm/ppmtowinicon.c 2017-09-05 15:09:01.004207383 +0200 ++++ new/converter/ppm/ppmtowinicon.c 2017-09-06 10:33:10.865812492 +0200 @@ -12,6 +12,7 @@ #include @@ -875,7 +791,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 c MALLOCARRAY_NOFAIL(rowData, rows); icBitmap->xBytes = xBytes; icBitmap->data = rowData; @@ -883,7 +799,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; @@ -891,7 +807,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; @@ -899,7 +815,7 @@ 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; @@ -910,10 +826,10 @@ diff -up netpbm-10.58.01/converter/ppm/ppmtowinicon.c.security-code netpbm-10.58 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 +diff -urNp old/converter/ppm/ppmtoxpm.c new/converter/ppm/ppmtoxpm.c +--- old/converter/ppm/ppmtoxpm.c 2017-09-05 15:09:01.004207383 +0200 ++++ new/converter/ppm/ppmtoxpm.c 2017-09-06 10:34:25.169426581 +0200 +@@ -198,6 +198,7 @@ genNumstr(unsigned int const input, int unsigned int i; /* Allocate memory for printed number. Abort if error. */ @@ -921,7 +837,7 @@ diff -up netpbm-10.58.01/converter/ppm/ppmtoxpm.c.security-code netpbm-10.58.01/ if (!(str = (char *) malloc(digits + 1))) pm_error("out of memory"); -@@ -314,6 +315,7 @@ genCmap(colorhist_vector const chv, +@@ -315,6 +316,7 @@ genCmap(colorhist_vector const chv, unsigned int charsPerPixel; unsigned int xpmMaxval; @@ -929,42 +845,43 @@ 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 -urNp old/converter/ppm/qrttoppm.c new/converter/ppm/qrttoppm.c +--- old/converter/ppm/qrttoppm.c 2017-09-05 15:09:01.004207383 +0200 ++++ new/converter/ppm/qrttoppm.c 2017-09-06 10:35:08.784199292 +0200 @@ -46,7 +46,7 @@ main( argc, argv ) ppm_writeppminit( stdout, cols, rows, maxval, 0 ); pixelrow = ppm_allocrow( cols ); - buf = (unsigned char *) malloc( 3 * cols ); -+ buf = (unsigned char *) malloc2( 3 , cols ); ++ buf = (unsigned char *) malloc2( 3, cols ); 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 -urNp old/converter/ppm/sldtoppm.c new/converter/ppm/sldtoppm.c +--- old/converter/ppm/sldtoppm.c 2017-09-05 15:09:01.002207393 +0200 ++++ new/converter/ppm/sldtoppm.c 2017-09-06 10:36:09.873951211 +0200 +@@ -463,7 +463,8 @@ slider(slvecfn slvec, + } /* Allocate image buffer and clear it to black. */ - +- + overflow_add(ixdots,1); -+ overflow_add(iydots,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 -@@ -117,6 +117,7 @@ ReadXimHeader(FILE * const in_fp, +diff -urNp old/converter/ppm/ximtoppm.c new/converter/ppm/ximtoppm.c +--- old/converter/ppm/ximtoppm.c 2017-09-05 15:09:01.003207388 +0200 ++++ new/converter/ppm/ximtoppm.c 2017-09-06 10:38:43.249091632 +0200 +@@ -118,6 +118,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" ); -@@ -126,6 +127,7 @@ ReadXimHeader(FILE * const in_fp, +@@ -127,6 +128,7 @@ ReadXimHeader(FILE * const in_fp, strncpy(header->author, a_head.author, strlen(a_head.author)); } if (strlen(a_head.date)) { @@ -972,7 +889,7 @@ diff -up netpbm-10.58.01/converter/ppm/ximtoppm.c.security-code netpbm-10.58.01/ if (!(header->date =calloc((unsigned int)strlen(a_head.date)+1,1))){ pm_message("ReadXimHeader: can't calloc date string" ); return(0); -@@ -134,6 +136,7 @@ ReadXimHeader(FILE * const in_fp, +@@ -135,6 +137,7 @@ ReadXimHeader(FILE * const in_fp, strncpy(header->date, a_head.date, strlen(a_head.date)); } if (strlen(a_head.program)) { @@ -980,28 +897,17 @@ diff -up netpbm-10.58.01/converter/ppm/ximtoppm.c.security-code netpbm-10.58.01/ if (!(header->program = calloc( (unsigned int)strlen(a_head.program) + 1, 1))) { pm_message("ReadXimHeader: can't calloc program string" ); -@@ -160,6 +163,7 @@ ReadXimHeader(FILE * const in_fp, +@@ -161,6 +164,7 @@ ReadXimHeader(FILE * const in_fp, 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/converter/ppm/yuvtoppm.c.security-code netpbm-10.58.01/converter/ppm/yuvtoppm.c ---- netpbm-10.58.01/converter/ppm/yuvtoppm.c.security-code 2012-04-09 15:31:44.000000000 +0200 -+++ netpbm-10.58.01/converter/ppm/yuvtoppm.c 2012-04-09 15:40:03.218619602 +0200 -@@ -72,6 +72,7 @@ main(argc, argv) - - ppm_writeppminit(stdout, cols, rows, (pixval) 255, 0); - pixrow = ppm_allocrow(cols); -+ overflow_add(cols, 1); - MALLOCARRAY(yuvbuf, (cols+1)/2); - if (yuvbuf == NULL) - pm_error("Unable to allocate YUV buffer for %d columns.", cols); -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 +diff -urNp old/editor/pamcut.c new/editor/pamcut.c +--- old/editor/pamcut.c 2017-09-05 15:09:00.983207488 +0200 ++++ new/editor/pamcut.c 2017-09-06 10:42:53.441815922 +0200 @@ -655,6 +655,8 @@ cutOneImage(FILE * const ifP outpam = inpam; /* Initial value -- most fields should be same */ @@ -1011,21 +917,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 -@@ -94,6 +94,7 @@ main( argc, argv ) - if (halftone == QT_FS) { - unsigned int col; - /* Initialize Floyd-Steinberg. */ -+ overflow_add(newcols, 2); - 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 -urNp old/editor/pnmgamma.c new/editor/pnmgamma.c +--- old/editor/pnmgamma.c 2017-09-05 15:09:00.985207478 +0200 ++++ new/editor/pnmgamma.c 2017-09-06 10:45:16.328461856 +0200 +@@ -596,6 +596,7 @@ createGammaTables(enum transferFunction xelval ** const btableP) { /* Allocate space for the tables. */ @@ -1033,10 +928,10 @@ 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 -urNp old/editor/pnmhisteq.c new/editor/pnmhisteq.c +--- old/editor/pnmhisteq.c 2017-09-05 15:09:00.983207488 +0200 ++++ new/editor/pnmhisteq.c 2017-09-06 10:46:30.959235397 +0200 +@@ -107,6 +107,7 @@ computeLuminosityHistogram(xel * const * unsigned int pixelCount; unsigned int * lumahist; @@ -1044,9 +939,9 @@ 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 +diff -urNp old/editor/pnmindex.csh new/editor/pnmindex.csh +--- old/editor/pnmindex.csh 2017-09-05 15:09:00.986207473 +0200 ++++ new/editor/pnmindex.csh 2017-09-06 10:47:46.007983350 +0200 @@ -1,5 +1,8 @@ #!/bin/csh -f # @@ -1056,10 +951,10 @@ diff -up netpbm-10.58.01/editor/pnmindex.csh.security-code netpbm-10.58.01/edito # 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 -@@ -527,6 +527,8 @@ main(int argc, const char ** argv) { +diff -urNp old/editor/pnmpad.c new/editor/pnmpad.c +--- old/editor/pnmpad.c 2017-09-05 15:09:00.983207488 +0200 ++++ new/editor/pnmpad.c 2017-09-06 10:48:42.415778475 +0200 +@@ -634,6 +634,8 @@ main(int argc, const char ** argv) { computePadSizes(cmdline, cols, rows, &lpad, &rpad, &tpad, &bpad); @@ -1068,19 +963,18 @@ 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 -urNp old/editor/pnmremap.c new/editor/pnmremap.c +--- old/editor/pnmremap.c 2017-09-05 15:09:00.984207483 +0200 ++++ new/editor/pnmremap.c 2017-09-06 10:49:56.879492310 +0200 +@@ -430,6 +430,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 +@@ -467,6 +468,7 @@ floydInitRow(struct pam * const pamP, st int col; @@ -1088,9 +982,9 @@ 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 +diff -urNp old/editor/pnmscalefixed.c new/editor/pnmscalefixed.c +--- old/editor/pnmscalefixed.c 2017-09-05 15:09:00.986207473 +0200 ++++ new/editor/pnmscalefixed.c 2017-09-06 10:52:07.110955503 +0200 @@ -214,6 +214,8 @@ compute_output_dimensions(const struct c const int rows, const int cols, int * newrowsP, int * newcolsP) { @@ -1104,7 +998,7 @@ diff -up netpbm-10.58.01/editor/pnmscalefixed.c.security-code netpbm-10.58.01/ed if (*newcolsP < 1) *newcolsP = 1; if (*newrowsP < 1) *newrowsP = 1; -+ ++ + overflow2(*newcolsP, *newrowsP); } @@ -1113,15 +1007,15 @@ diff -up netpbm-10.58.01/editor/pnmscalefixed.c.security-code netpbm-10.58.01/ed 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/pnmshear.c.security-code netpbm-10.58.01/editor/pnmshear.c ---- netpbm-10.58.01/editor/pnmshear.c.security-code 2012-04-09 15:31:33.000000000 +0200 -+++ netpbm-10.58.01/editor/pnmshear.c 2012-04-09 15:40:03.224619526 +0200 +diff -urNp old/editor/pnmshear.c new/editor/pnmshear.c +--- old/editor/pnmshear.c 2017-09-05 15:09:00.985207478 +0200 ++++ new/editor/pnmshear.c 2017-09-06 11:57:18.485705533 +0200 @@ -15,6 +15,7 @@ #include #include @@ -1129,8 +1023,8 @@ diff -up netpbm-10.58.01/editor/pnmshear.c.security-code netpbm-10.58.01/editor/ +#include #include "pm_c_util.h" - #include "ppm.h" -@@ -236,6 +237,11 @@ main(int argc, char * argv[]) { + #include "mallocvar.h" +@@ -242,6 +243,11 @@ main(int argc, const char * argv[]) { shearfac = fabs(tan(cmdline.angle)); @@ -1142,25 +1036,23 @@ diff -up netpbm-10.58.01/editor/pnmshear.c.security-code netpbm-10.58.01/editor/ newcols = rows * shearfac + cols + 0.999999; pnm_writepnminit(stdout, newcols, rows, newmaxval, newformat, 0); -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) +diff -urNp old/editor/ppmdither.c new/editor/ppmdither.c +--- old/editor/ppmdither.c 2017-09-05 15:09:00.984207483 +0200 ++++ new/editor/ppmdither.c 2017-09-06 11:57:58.507533974 +0200 +@@ -355,6 +355,10 @@ dithMatrix(unsigned int const dithPower) unsigned int const dithMatSize = (dithDim * sizeof(*dithMat)) + /* pointers */ (dithDim * dithDim * sizeof(**dithMat)); /* data */ -- + + overflow2(dithDim, sizeof(*dithMat)); + overflow3(dithDim, dithDim, sizeof(**dithMat)); + overflow_add(dithDim * sizeof(*dithMat), dithDim * dithDim * sizeof(**dithMat)); -+ + 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 -urNp old/editor/specialty/pamoil.c new/editor/specialty/pamoil.c +--- old/editor/specialty/pamoil.c 2017-09-05 15:09:00.986207473 +0200 ++++ new/editor/specialty/pamoil.c 2017-09-06 11:58:39.091357659 +0200 @@ -112,6 +112,7 @@ main(int argc, char *argv[] ) { tuples = pnm_readpam(ifp, &inpam, PAM_STRUCT_SIZE(tuple_type)); pm_close(ifp); @@ -1169,68 +1061,37 @@ 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 ** - - for (i = 1; i < argc; ++i) { +diff -urNp old/generator/pbmtext.c new/generator/pbmtext.c +--- old/generator/pbmtext.c 2017-09-05 15:09:00.957207619 +0200 ++++ new/generator/pbmtext.c 2017-09-06 12:02:22.348352850 +0200 +@@ -125,6 +125,7 @@ parseCommandLine(int argc, const char ** if (i > 1) { -+ overflow_add(totaltextsize, 1); - totaltextsize += 1; - text = realloc(text, totaltextsize); - 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 ++ overflow_add(totaltextsize, strlen(argv[i]) + 1); + totaltextsize += strlen(argv[i]) + 1; + if (totaltextsize > MAXLINECHARS) + pm_error("input text too long"); +@@ -745,6 +746,7 @@ getText(char const cmdlineText[ pm_error("A line of input text is longer than %u characters." - "Cannot process.", (unsigned)sizeof(buf)-1); + "Cannot process", (unsigned int) MAXLINECHARS-1); if (lineCount >= maxlines) { -+ overflow2(maxlines, 2); ++ overflow2(maxlines, 2); maxlines *= 2; - REALLOCARRAY(text_array, maxlines); - if (text_array == NULL) -@@ -832,6 +835,7 @@ main(int argc, const char *argv[]) { - hmargin = fontP->maxwidth; + REALLOCARRAY(textArray, maxlines); + if (textArray == NULL) +@@ -781,6 +783,7 @@ computeMargins(struct CmdlineInfo const + *hmarginP = fontP->maxwidth; } else { - vmargin = fontP->maxheight; + *vmarginP = fontP->maxheight; + overflow2(2, fontP->maxwidth); - hmargin = 2 * fontP->maxwidth; + *hmarginP = 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/generator/pgmkernel.c.security-code netpbm-10.58.01/generator/pgmkernel.c ---- netpbm-10.58.01/generator/pgmkernel.c.security-code 2012-04-09 15:31:34.000000000 +0200 -+++ netpbm-10.58.01/generator/pgmkernel.c 2012-04-09 15:40:03.226619502 +0200 -@@ -68,7 +68,7 @@ main ( argc, argv ) - kycenter = (fysize - 1) / 2.0; - ixsize = fxsize + 0.999; - iysize = fysize + 0.999; -- MALLOCARRAY(fkernel, ixsize * iysize); -+ fkernel = (double *) malloc3 (ixsize, iysize, sizeof(double)); - for (i = 0; i < iysize; i++) - for (j = 0; j < ixsize; j++) { - fkernel[i*ixsize+j] = 1.0 / (1.0 + w * sqrt((double) -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 -urNp old/lib/libpam.c new/lib/libpam.c +--- old/lib/libpam.c 2017-09-05 15:09:00.978207513 +0200 ++++ new/lib/libpam.c 2017-09-06 12:06:07.132297384 +0200 +@@ -225,7 +225,8 @@ allocPamRow(const struct pam * const pam unsigned int const bytesPerTuple = allocationDepth(pamP) * sizeof(sample); tuple * tuplerow; @@ -1240,10 +1101,10 @@ diff -up netpbm-10.58.01/lib/libpam.c.security-code netpbm-10.58.01/lib/libpam.c 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 +diff -urNp old/lib/libpammap.c new/lib/libpammap.c +--- old/lib/libpammap.c 2017-09-05 15:09:00.977207518 +0200 ++++ new/lib/libpammap.c 2017-09-06 12:06:50.764088850 +0200 +@@ -108,6 +108,8 @@ allocTupleIntListItem(struct pam * const */ struct tupleint_list_item * retval; @@ -1252,21 +1113,21 @@ diff -up netpbm-10.58.01/lib/libpammap.c.security-code netpbm-10.58.01/lib/libpa unsigned int const size = sizeof(*retval) - sizeof(retval->tupleint.tuple) + pamP->depth * sizeof(sample); -diff -up netpbm-10.58.01/lib/libpbm1.c.security-code netpbm-10.58.01/lib/libpbm1.c ---- netpbm-10.58.01/lib/libpbm1.c.security-code 2012-04-09 15:31:38.000000000 +0200 -+++ netpbm-10.58.01/lib/libpbm1.c 2012-04-09 15:40:03.228619477 +0200 -@@ -77,6 +77,7 @@ pbm_check(FILE * file, const enum pm_che - pm_message("pm_filepos passed to pm_check() is %u bytes", - sizeof(pm_filepos)); - #endif -+ overflow2(bytes_per_row, rows); - pm_check(file, check_type, need_raster_size, retval_p); - } - } -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 -urNp old/lib/libpbm1.c new/lib/libpbm1.c +--- old/lib/libpbm1.c 2017-09-05 15:09:00.978207513 +0200 ++++ new/lib/libpbm1.c 2017-09-06 12:11:41.063680260 +0200 +@@ -77,6 +77,7 @@ pbm_check(FILE * const fil + if (retvalP) + *retvalP = PM_CHECK_UNCHECKABLE; + } else { ++ overflow_add(cols, 7); + pm_filepos const bytesPerRow = (cols+7)/8; + pm_filepos const needRasterSize = rows * bytesPerRow; + pm_check(fileP, checkType, needRasterSize, retvalP); +diff -urNp old/lib/libpm.c new/lib/libpm.c +--- old/lib/libpm.c 2017-09-05 15:09:00.977207518 +0200 ++++ new/lib/libpm.c 2017-09-06 12:13:26.144162930 +0200 +@@ -889,4 +889,52 @@ pm_parse_height(const char * const arg) } @@ -1295,7 +1156,7 @@ diff -up netpbm-10.58.01/lib/libpm.c.security-code netpbm-10.58.01/lib/libpm.c + if( a > INT_MAX - b) + pm_error("object too large"); +} -+ + +void *malloc2(int a, int b) +{ + overflow2(a, b); @@ -1319,37 +1180,44 @@ diff -up netpbm-10.58.01/lib/libpm.c.security-code netpbm-10.58.01/lib/libpm.c + 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 -urNp old/lib/pm.h new/lib/pm.h +--- old/lib/pm.h 2017-09-05 15:09:00.979207508 +0200 ++++ new/lib/pm.h 2017-09-06 12:14:44.159772344 +0200 +@@ -435,5 +435,11 @@ pm_parse_height(const char * const arg); + } #endif - +void *malloc2(int, int); +void *malloc3(int, int, int); +#define overflow2(a,b) __overflow2(a,b) +void __overflow2(int, int); +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 -urNp old/other/pnmcolormap.c new/other/pnmcolormap.c +--- old/other/pnmcolormap.c 2017-09-05 15:09:00.982207493 +0200 ++++ new/other/pnmcolormap.c 2017-09-06 12:16:38.998195226 +0200 +@@ -836,10 +836,12 @@ colormapToSquare(struct pam * const pamP + tuple *** const outputRasterP) { + { + unsigned int const intsqrt = (int)sqrt((float)colormap.size); +- if (intsqrt * intsqrt == colormap.size) ++ if (intsqrt * intsqrt == colormap.size) pamP->width = intsqrt; - else - pamP->width = intsqrt + 1; -+ overflow_add(intsqrt, 1); +- else +- pamP->width = intsqrt + 1; ++ else { ++ overflow_add(intsqrt, 1); ++ pamP->width = intsqrt + 1; ++ } } { 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 +diff -urNp old/urt/README new/urt/README +--- old/urt/README 2017-09-05 15:09:00.975207528 +0200 ++++ new/urt/README 2017-09-06 12:18:11.582728375 +0200 +@@ -18,3 +18,12 @@ 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. @@ -1358,26 +1226,30 @@ diff -up netpbm-10.58.01/urt/README.security-code netpbm-10.58.01/urt/README +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 ++ ++Update Alan's changes for version 10.79.00. ++ ++Josef Ridky +diff -urNp old/urt/rle_addhist.c new/urt/rle_addhist.c +--- old/urt/rle_addhist.c 2017-09-05 15:09:00.976207523 +0200 ++++ new/urt/rle_addhist.c 2017-09-06 12:20:37.615007358 +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 ++ * 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[], +@@ -70,13 +72,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])); ++ overflow_add(length, strlen(argv[i])); ++ overflow_add(length+1, strlen(argv[i])); length += strlen(argv[i]) +1; /* length of each arg plus space. */ + } @@ -1391,13 +1263,13 @@ diff -up netpbm-10.58.01/urt/rle_addhist.c.security-code netpbm-10.58.01/urt/rle 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[], +@@ -84,9 +92,12 @@ rle_addhist(char * argv[], else old = NULL; - if (old && *old) + if (old && *old) { -+ overflow_add(length, strlen(old)); ++ overflow_add(length, strlen(old)); length += strlen(old); /* add length if there. */ + } @@ -1405,9 +1277,9 @@ diff -up netpbm-10.58.01/urt/rle_addhist.c.security-code netpbm-10.58.01/urt/rle ++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 +diff -urNp old/urt/rle_getrow.c new/urt/rle_getrow.c +--- old/urt/rle_getrow.c 2017-09-05 15:09:00.976207523 +0200 ++++ new/urt/rle_getrow.c 2017-09-06 12:21:51.591095294 +0200 @@ -17,6 +17,8 @@ * * Modified at BRL 16-May-88 by Mike Muuss to avoid Alliant STDC desire @@ -1417,23 +1289,54 @@ diff -up netpbm-10.58.01/urt/rle_getrow.c.security-code netpbm-10.58.01/urt/rle_ */ /* * rle_getrow.c - Read an RLE file in. -@@ -168,6 +170,7 @@ rle_get_setup(rle_hdr * const the_hdr) { - register char * cp; +@@ -160,6 +162,7 @@ rle_get_setup(rle_hdr * const the_hdr) { + char * cp; - VAXSHORT( comlen, infile ); /* get comment length */ -+ overflow_add(comlen, 1); + 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 + if (evenlen) { + MALLOCARRAY(comment_buf, evenlen); +diff -urNp old/urt/rle.h new/urt/rle.h +--- old/urt/rle.h 2017-09-05 15:09:00.976207523 +0200 ++++ new/urt/rle.h 2017-09-06 12:28:40.502652837 +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. +@@ -161,6 +164,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); ++extern void overflow3(int, int, int); ++extern void *malloc2(int, int); ++extern void *malloc3(int, int, int); ++extern void *realloc2(void *, int, int); + + /* Declare RLE library routines. */ + +diff -urNp old/urt/rle_hdr.c new/urt/rle_hdr.c +--- old/urt/rle_hdr.c 2017-09-05 15:09:00.976207523 +0200 ++++ new/urt/rle_hdr.c 2017-09-06 12:27:23.846827208 +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 ++ * 2002-12-19: Fix maths wrapping bugs. Alan Cox */ /* * rle_hdr.c - Functions to manipulate rle_hdr structures. @@ -1442,97 +1345,66 @@ diff -up netpbm-10.58.01/urt/rle_hdr.c.security-code netpbm-10.58.01/urt/rle_hdr if ( the_hdr->cmd != pgmname ) { - char *tmp = (char *)malloc( strlen( pgmname ) + 1 ); -+ char *tmp ; ++ char *tmp; + -+ overflow_add(strlen(pgmname), 1); -+ tmp = malloc( strlen( pgmname ) + 1 ); ++ overflow_add(strlen(pgmname), 1); ++ tmp = (char *)malloc( strlen( pgmname ) + 1 ); RLE_CHECK_ALLOC( pgmname, tmp, 0 ); strcpy( tmp, pgmname ); the_hdr->cmd = tmp; -@@ -88,7 +93,9 @@ int img_num; +@@ -88,7 +93,10 @@ 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 ); ++ ++ overflow_add(strlen(fname), 1); ++ tmp = (char *)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; +@@ -152,6 +160,7 @@ rle_hdr *from_hdr, *to_hdr; + if ( to_hdr->bg_color ) { ++ overflow2(to_hdr->ncolors, sizeof(int)); 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; +@@ -161,7 +170,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)); ++ 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; +@@ -174,11 +183,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); ++ { ++ overflow_add(size, 1); size++; /* Count the comments. */ -+ } ++ } /* Check if there are really any comments. */ if ( size ) { -+ overflow_add(size, 1); ++ overflow_add(size, 1); size++; /* Copy the NULL pointer, too. */ -+ overflow2(size, sizeof(char *)); ++ 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. * - */ - 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); -+extern void overflow3(int, int, int); -+extern void *malloc2(int, int); -+extern void *malloc3(int, int, int); -+extern void *realloc2(void *, int, int); - - /* 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 - FILE ** const fpP, +diff -urNp old/urt/rle_open_f.c new/urt/rle_open_f.c +--- old/urt/rle_open_f.c 2017-09-05 15:09:00.976207523 +0200 ++++ new/urt/rle_open_f.c 2017-09-06 12:30:07.309418990 +0200 +@@ -164,64 +164,7 @@ dealWithSubprocess(const char * const f bool * const noSubprocessP, const char ** const errorP) { -- + -#ifdef NO_OPEN_PIPES *noSubprocessP = TRUE; -#else @@ -1594,15 +1466,15 @@ 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 +diff -urNp old/urt/rle_putcom.c new/urt/rle_putcom.c +--- old/urt/rle_putcom.c 2017-09-05 15:09:00.976207523 +0200 ++++ new/urt/rle_putcom.c 2017-09-06 12:31:29.550158232 +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 ++ * ++ * 2002-12-19: Fix maths wrapping bugs. Alan Cox */ /* * rle_putcom.c - Add a picture comment to the header struct. @@ -1612,19 +1484,19 @@ diff -up netpbm-10.58.01/urt/rle_putcom.c.security-code netpbm-10.58.01/urt/rle_ 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 +diff -urNp old/urt/Runput.c new/urt/Runput.c +--- old/urt/Runput.c 2017-09-05 15:09:00.976207523 +0200 ++++ new/urt/Runput.c 2017-09-06 12:33:47.933658290 +0200 @@ -17,6 +17,8 @@ * * Modified at BRL 16-May-88 by Mike Muuss to avoid Alliant STDC desire @@ -1643,8 +1515,8 @@ diff -up netpbm-10.58.01/urt/Runput.c.security-code netpbm-10.58.01/urt/Runput.c + register rle_pixel *background; register int *bg_color; + -+ overflow_add(the_hdr->ncolors,1); -+ background = (rle_pixel *)malloc( (unsigned)(the_hdr->ncolors + 1) ); ++ 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. @@ -1657,9 +1529,9 @@ diff -up netpbm-10.58.01/urt/Runput.c.security-code netpbm-10.58.01/urt/Runput.c 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 +diff -urNp old/urt/scanargs.c new/urt/scanargs.c +--- old/urt/scanargs.c 2017-09-05 15:09:00.976207523 +0200 ++++ new/urt/scanargs.c 2017-09-06 12:35:21.372289086 +0200 @@ -38,6 +38,8 @@ * * Modified at BRL 16-May-88 by Mike Muuss to avoid Alliant STDC desire @@ -1669,13 +1541,13 @@ diff -up netpbm-10.58.01/urt/scanargs.c.security-code netpbm-10.58.01/urt/scanar */ #include -@@ -63,8 +65,8 @@ typedef int *ptr; +@@ -62,8 +64,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 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 ); diff --git a/SOURCES/netpbm-security-scripts.patch b/SOURCES/netpbm-security-scripts.patch index 831be82..24675fb 100644 --- a/SOURCES/netpbm-security-scripts.patch +++ b/SOURCES/netpbm-security-scripts.patch @@ -1,19 +1,18 @@ -diff -up netpbm-10.47.05/converter/other/anytopnm.security-scripts netpbm-10.47.05/converter/other/anytopnm ---- netpbm-10.47.05/converter/other/anytopnm.security-scripts 2009-12-10 08:34:36.000000000 +0100 -+++ netpbm-10.47.05/converter/other/anytopnm 2010-03-16 21:28:09.000000000 +0100 -@@ -510,10 +510,7 @@ else - inputFile="-" +diff -urNp old/converter/other/anytopnm neew/converter/other/anytopnm +--- old/converter/other/anytopnm 2017-09-05 12:58:26.795741945 +0200 ++++ neew/converter/other/anytopnm 2017-09-05 13:03:12.985472566 +0200 +@@ -537,9 +537,8 @@ else + fi --tempdir="${TMPDIR-/tmp}/anytopnm.$$" --mkdir -m 0700 $tempdir || \ -- { echo "Could not create temporary file. Exiting."; exit 1;} +-tempdir=$(mktemp -d "${TMPDIR:-/tmp}/anytopnm.XXXXXXXX") || ++tempdir=$(mktemp -d -t anytopnm.XXXXXXXX) || + ( echo "Could not create temporary file. Exiting." 1>&2; exit 1; ) -trap 'rm -rf $tempdir' 0 -+tempdir=$(mktemp -d -t anytopnm.XXXXXXXXXX) || exit 1 # Take out all spaces # Find the filename extension for last-ditch efforts later -@@ -539,9 +536,17 @@ if [ "$filetype" = "unknown" ]; then +@@ -565,9 +564,17 @@ if [ "$filetype" = "unknown" ]; then echo "$progname: unknown file type. " \ "'file' says mime type is '$mimeType', " 1>&2 echo "type description is '$typeDescription'" 1>&2 @@ -31,17 +30,16 @@ diff -up netpbm-10.47.05/converter/other/anytopnm.security-scripts netpbm-10.47. +fi + exit 0 -diff -up netpbm-10.47.05/editor/pamstretch-gen.security-scripts netpbm-10.47.05/editor/pamstretch-gen ---- netpbm-10.47.05/editor/pamstretch-gen.security-scripts 2009-12-10 08:34:32.000000000 +0100 -+++ netpbm-10.47.05/editor/pamstretch-gen 2010-03-16 21:28:47.000000000 +0100 -@@ -31,13 +31,9 @@ if [ "$1" = "" ]; then +diff -urNp old/editor/pamstretch-gen neew/editor/pamstretch-gen +--- old/editor/pamstretch-gen 2017-09-05 12:58:26.763741946 +0200 ++++ neew/editor/pamstretch-gen 2017-09-05 13:03:12.985472566 +0200 +@@ -34,12 +34,10 @@ if [ "$1" = "" ]; then exit 1 fi --tempdir="${TMPDIR-/tmp}/pamstretch-gen.$$" --mkdir -m 0700 $tempdir || \ -- { echo "Could not create temporary file. Exiting."; exit 1;} -+tempfile=$(mktemp /tmp/pnmig.XXXXXXXXXX) || exit 1 +-tempdir=$(mktemp -d "${TMPDIR:-/tmp}/netpbm.XXXXXXXX") || ++tempfile=$(mktemp /tmp/pnmig.XXXXXXXX) || + ( echo "Could not create temporary file. Exiting." 1>&2; exit 1; ) trap 'rm -rf $tempdir' 0 1 3 15 -tempfile=$tempdir/pnmig @@ -49,59 +47,18 @@ diff -up netpbm-10.47.05/editor/pamstretch-gen.security-scripts netpbm-10.47.05/ if ! cat $2 >$tempfile 2>/dev/null; then echo 'pamstretch-gen: error reading file' 1>&2 exit 1 -diff -up netpbm-10.47.05/editor/pnmmargin.security-scripts netpbm-10.47.05/editor/pnmmargin ---- netpbm-10.47.05/editor/pnmmargin.security-scripts 2009-12-10 08:34:32.000000000 +0100 -+++ netpbm-10.47.05/editor/pnmmargin 2010-03-16 21:28:09.000000000 +0100 -@@ -11,15 +11,11 @@ - # documentation. This software is provided "as is" without express or - # implied warranty. - --tempdir="${TMPDIR-/tmp}/pnmmargin.$$" --mkdir -m 0700 $tempdir || \ -- { echo "Could not create temporary file. Exiting." 1>&2; exit 1;} --trap 'rm -rf $tempdir' 0 1 3 15 -- --tmp1=$tempdir/pnmm1 --tmp2=$tempdir/pnmm2 --tmp3=$tempdir/pnmm3 --tmp4=$tempdir/pnmm4 -+tmpdir=$(mktemp -d -t ppmmargin.XXXXXXX) || exit 1 -+tmp1="$tmpdir/tmp1" -+tmp2="$tmpdir/tmp2" -+tmp3="$tmpdir/tmp3" -+tmp4="$tmpdir/tmp4" - - color="-gofigure" - plainopt="" -@@ -90,6 +86,7 @@ else - -white | -black ) - pnmpad $plainopt $color \ - -left=$size -right=$size -top=$size -bottom=$size $tmp1 -+ rm -rf "$tmpdir" - exit - ;; - * ) -@@ -102,7 +99,4 @@ else - pnmcat -lr $tmp2 $tmp1 $tmp2 > $tmp4 - pnmcat -tb $plainopt $tmp3 $tmp4 $tmp3 - fi -- -- -- -- -+rm -rf "$tmpdir" -diff -up netpbm-10.47.05/editor/ppmfade.security-scripts netpbm-10.47.05/editor/ppmfade ---- netpbm-10.47.05/editor/ppmfade.security-scripts 2009-12-10 08:34:32.000000000 +0100 -+++ netpbm-10.47.05/editor/ppmfade 2010-03-16 21:28:09.000000000 +0100 -@@ -14,6 +14,7 @@ +diff -urNp old/editor/ppmfade neew/editor/ppmfade +--- old/editor/ppmfade 2017-09-05 12:58:26.767741946 +0200 ++++ neew/editor/ppmfade 2017-09-05 12:59:14.556731156 +0200 +@@ -40,6 +40,7 @@ exec perl -w -x -S -- "$0" "$@" # - #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + ############################################################################## use strict; +use File::Temp "tempdir"; - my $SPREAD = 1; - my $SHIFT = 2; -@@ -111,20 +112,26 @@ if ($first_file ne "undefined") { + sub doVersionHack($) { + my ($argvR) = @_; +@@ -149,20 +149,26 @@ if ($first_file ne "undefined") { print("Frames are " . $width . "W x " . $height . "H\n"); @@ -132,7 +89,7 @@ diff -up netpbm-10.47.05/editor/ppmfade.security-scripts netpbm-10.47.05/editor/ } # -@@ -132,14 +139,14 @@ if ($last_file eq "undefined") { +@@ -170,14 +176,14 @@ if ($last_file eq "undefined") { # # Here's what our temporary files are: @@ -155,7 +112,7 @@ diff -up netpbm-10.47.05/editor/ppmfade.security-scripts netpbm-10.47.05/editor/ my $i; # Frame number for ($i = 1; $i <= $nframes; $i++) { -@@ -147,147 +154,147 @@ for ($i = 1; $i <= $nframes; $i++) { +@@ -185,147 +191,147 @@ for ($i = 1; $i <= $nframes; $i++) { if ($mode eq $SPREAD) { if ($i <= 10) { my $n = $spline20[$i] * 100; @@ -356,20 +313,23 @@ diff -up netpbm-10.47.05/editor/ppmfade.security-scripts netpbm-10.47.05/editor/ +system("rm $tmpdir/junk*$$.ppm"); exit(0); -diff -up netpbm-10.47.05/editor/ppmshadow.security-scripts netpbm-10.47.05/editor/ppmshadow ---- netpbm-10.47.05/editor/ppmshadow.security-scripts 2009-12-10 08:34:32.000000000 +0100 -+++ netpbm-10.47.05/editor/ppmshadow 2010-03-16 21:28:09.000000000 +0100 -@@ -72,9 +72,10 @@ sub makeConvolutionKernel($$) { - +diff -urNp old/editor/ppmshadow neew/editor/ppmshadow +--- old/editor/ppmshadow 2017-09-05 12:58:26.768741946 +0200 ++++ neew/editor/ppmshadow 2017-09-05 13:02:51.480507649 +0200 +@@ -171,11 +171,12 @@ my $tmpdir = $ENV{TMPDIR} || "/tmp"; + my $ourtmp; - my $tmpdir = $ENV{TMPDIR} || "/tmp"; --my $ourtmp = "$tmpdir/ppmshadow$$"; --mkdir($ourtmp, 0777) or -- die("Unable to create directory for temporary files '$ourtmp"); -+my $ourtmp; chomp($ourtmp = `mktemp -d -t PPMshadow.XXXXXX`); -+if ($? >> 8) { -+ die "Can't create directory for temporary files"; -+} - - # Process command line options + if ($keeptemp) { +- $ourtmp = "$tmpdir/ppmshadow$$"; +- mkdir($ourtmp, 0777) or +- die("Unable to create directory for temporary files '$ourtmp"); ++ $ourtmp = chomp($ourtmp = `mktemp -d -t PPMshadow.XXXXXX`); ++ if($? >> 8) { ++ die "Can't create directory for temporary files"; ++ } + } else { +- $ourtmp = File::Temp::tempdir("$tmpdir/ppmshadowXXXX", UNLINK=>1); ++ $ourtmp = File::Temp::tempdir("$tmpdir/PPMshadow.XXXXXX", UNLINK=>1); + } + # Apply defaults for arguments not specified diff --git a/SPECS/netpbm.spec b/SPECS/netpbm.spec index c0a2d27..82eafb8 100644 --- a/SPECS/netpbm.spec +++ b/SPECS/netpbm.spec @@ -1,7 +1,7 @@ Summary: A library for handling different graphics file formats Name: netpbm -Version: 10.61.02 -Release: 9%{?dist} +Version: 10.79.00 +Release: 7%{?dist} # See copyright_summary for details License: BSD and GPLv2 and IJG and MIT and Public Domain Group: System Environment/Libraries @@ -17,29 +17,20 @@ Patch1: netpbm-time.patch Patch2: netpbm-message.patch Patch3: netpbm-security-scripts.patch Patch4: netpbm-security-code.patch -Patch5: netpbm-nodoc.patch -Patch6: netpbm-gcc4.patch -Patch7: netpbm-bmptopnm.patch -Patch8: netpbm-CAN-2005-2471.patch -Patch9: netpbm-xwdfix.patch -Patch11: netpbm-multilib.patch -Patch13: netpbm-glibc.patch -Patch15: netpbm-docfix.patch -Patch16: netpbm-ppmfadeusage.patch -Patch17: netpbm-fiasco-overflow.patch -Patch20: netpbm-noppmtompeg.patch -Patch21: netpbm-cmuwtopbm.patch -Patch22: netpbm-pamtojpeg2k.patch -Patch23: netpbm-manfix.patch -Patch24: netpbm-ppmtopict.patch -Patch25: netpbm-pnmtopclxl.patch -#Patch26: netpbm-man-repeated.patch -Patch27: netpbm-multipage-pam.patch -Patch28: netpbm-compare-same-images.patch -#Patch29: netpbm-man-corrections.patch -Patch29: netpbm-manual-pages.patch -Patch30: netpbm-pnmtops-hangs.patch -Patch31: netpbm-pgmtexture-fault.patch +Patch5: netpbm-gcc4.patch +Patch6: netpbm-bmptopnm.patch +Patch7: netpbm-CAN-2005-2471.patch +Patch8: netpbm-xwdfix.patch +Patch9: netpbm-multilib.patch +Patch10: netpbm-glibc.patch +Patch11: netpbm-docfix.patch +Patch12: netpbm-fiasco-overflow.patch +Patch13: netpbm-noppmtompeg.patch +Patch14: netpbm-cmuwtopbm.patch +Patch15: netpbm-pamtojpeg2k.patch +Patch16: netpbm-manfix.patch +Patch17: netpbm-manual-pages.patch +Patch18: netpbm-ppmfadeusage.patch BuildRequires: libjpeg-devel, libpng-devel, libtiff-devel, flex BuildRequires: libX11-devel, python, jasper-devel, libxml2-devel @@ -97,33 +88,23 @@ netpbm-doc. You'll also need to install the netpbm-progs package. %patch2 -p1 -b .message %patch3 -p1 -b .security-scripts %patch4 -p1 -b .security-code -%patch5 -p1 -b .nodoc -%patch6 -p1 -b .gcc4 -%patch7 -p1 -b .bmptopnm -%patch8 -p1 -b .CAN-2005-2471 -%patch9 -p1 -b .xwdfix -%patch11 -p1 -b .multilib -%patch13 -p1 -b .glibc -%patch15 -p1 -%patch16 -p1 -b .ppmfadeusage -%patch17 -p1 -b .fiasco-overflow -%patch20 -p1 -b .noppmtompeg -%patch21 -p1 -b .cmuwtopbmfix -%patch22 -p1 -b .pamtojpeg2kfix -%patch23 -p1 -b .manfix -%patch24 -p1 -b .ppmtopict -%patch25 -p1 -b .pnmtopclxl -#%patch26 -p1 -b .man-repeated -%patch27 -p1 -b .multipage-pam -%patch28 -p1 -b .compare-same-images -#%patch29 -p1 -b .man-corrections -%patch29 -p1 -b .manual-pages -%patch30 -p1 -b .pnmtops-hangs -%patch31 -p1 -b .pgmtexture-fault - -sed -i 's/STRIPFLAG = -s/STRIPFLAG =/g' config.mk.in +%patch5 -p1 -b .gcc4 +%patch6 -p1 -b .bmptopnm +%patch7 -p1 -b .CAN-2005-2471 +%patch8 -p1 -b .xwdfix +%patch9 -p1 -b .multilib +%patch10 -p1 -b .glibc +%patch11 -p1 +%patch12 -p1 -b .fiasco-overflow +%patch13 -p1 -b .noppmtompeg +%patch14 -p1 -b .cmuwtopbmfix +%patch15 -p1 -b .pamtojpeg2kfix +%patch16 -p1 -b .manfix +%patch17 -p1 -b .manual-pages +%patch18 -p1 -b .ppmfadeusage + rm -rf converter/other/jpeg2000/libjasper/ -sed -i -e 's/^SUBDIRS = libjasper/SUBDIRS =/' converter/other/jpeg2000/Makefile +sed -i -e 's/SUBDIRS += libjasper//' converter/other/jpeg2000/Makefile %build ./configure < - 10.79.00-7 +- Revert to version 10.79.00-4 due suggested changes didn't work + +* Thu Jan 11 2018 Josef Ridky - 10.79.00-6 +- Spec update for RPM-Diff error + +* Thu Jan 04 2018 Josef Ridky - 10.79.00-5 +- Fix RPM-Diff issue with relro on ppx64[le] arch (#1523946) + +* Thu Jan 04 2018 Josef Ridky - 10.79.00-4 +- Resolves: #1523176 - add manual page for ppmtopga +- Resolves: #1530606 - pbmtoepson command line option fix + +* Wed Nov 01 2017 Josef Ridky - 10.79.00-3 +- Resolves: #1507569 - ppmfade error reporting + +* Wed Nov 01 2017 Josef Ridky - 10.79.00-2 +- Resolves: #1507963 - fix ppmfade error with undefined subroutine + +* Tue Sep 05 2017 Josef Ridky - 10.79.00-1 +- Resolves: #1381122 - Rebase to the latest upstream version + * Tue Feb 25 2014 Petr Hracek - 10.61.02-9 - Resolves: #1052154 - Pgmtexture gets aborted