summaryrefslogtreecommitdiff
path: root/manualPorts/netpbm
diff options
context:
space:
mode:
Diffstat (limited to 'manualPorts/netpbm')
-rw-r--r--manualPorts/netpbm/.footprint752
-rw-r--r--manualPorts/netpbm/.md5sum8
-rw-r--r--manualPorts/netpbm/.signature12
-rw-r--r--manualPorts/netpbm/Pkgfile55
-rw-r--r--manualPorts/netpbm/netpbm-CAN-2005-2471.patch16
-rw-r--r--manualPorts/netpbm/netpbm-security-code.patch1432
-rw-r--r--manualPorts/netpbm/netpbm-security-scripts.patch369
-rw-r--r--manualPorts/netpbm/reproducible-man-gzip.patch16
-rw-r--r--manualPorts/netpbm/use-source-date-epoch.patch13
9 files changed, 2673 insertions, 0 deletions
diff --git a/manualPorts/netpbm/.footprint b/manualPorts/netpbm/.footprint
new file mode 100644
index 0000000..f0697f5
--- /dev/null
+++ b/manualPorts/netpbm/.footprint
@@ -0,0 +1,752 @@
+drwxr-xr-x root/root usr/
+drwxr-xr-x root/root usr/bin/
+-rwxr-xr-x root/root usr/bin/411toppm
+-rwxr-xr-x root/root usr/bin/anytopnm
+-rwxr-xr-x root/root usr/bin/asciitopgm
+-rwxr-xr-x root/root usr/bin/atktopbm
+-rwxr-xr-x root/root usr/bin/avstopam
+-rwxr-xr-x root/root usr/bin/bioradtopgm
+-rwxr-xr-x root/root usr/bin/bmptopnm
+lrwxrwxrwx root/root usr/bin/bmptoppm -> bmptopnm
+-rwxr-xr-x root/root usr/bin/brushtopbm
+-rwxr-xr-x root/root usr/bin/cameratopam
+-rwxr-xr-x root/root usr/bin/cistopbm
+-rwxr-xr-x root/root usr/bin/cmuwmtopbm
+-rwxr-xr-x root/root usr/bin/ddbugtopbm
+-rwxr-xr-x root/root usr/bin/escp2topbm
+-rwxr-xr-x root/root usr/bin/eyuvtoppm
+-rwxr-xr-x root/root usr/bin/fiascotopnm
+-rwxr-xr-x root/root usr/bin/fitstopnm
+-rwxr-xr-x root/root usr/bin/fstopgm
+-rwxr-xr-x root/root usr/bin/g3topbm
+lrwxrwxrwx root/root usr/bin/gemtopbm -> gemtopnm
+-rwxr-xr-x root/root usr/bin/gemtopnm
+-rwxr-xr-x root/root usr/bin/giftopnm
+-rwxr-xr-x root/root usr/bin/gouldtoppm
+-rwxr-xr-x root/root usr/bin/hdifftopam
+-rwxr-xr-x root/root usr/bin/hipstopgm
+-rwxr-xr-x root/root usr/bin/hpcdtoppm
+lrwxrwxrwx root/root usr/bin/icontopbm -> sunicontopnm
+-rwxr-xr-x root/root usr/bin/ilbmtoppm
+-rwxr-xr-x root/root usr/bin/imgtoppm
+-rwxr-xr-x root/root usr/bin/infotopam
+-rwxr-xr-x root/root usr/bin/jbigtopnm
+-rwxr-xr-x root/root usr/bin/jpeg2ktopam
+-rwxr-xr-x root/root usr/bin/jpegtopnm
+-rwxr-xr-x root/root usr/bin/leaftoppm
+-rwxr-xr-x root/root usr/bin/lispmtopgm
+-rwxr-xr-x root/root usr/bin/macptopbm
+-rwxr-xr-x root/root usr/bin/manweb
+-rwxr-xr-x root/root usr/bin/mdatopbm
+-rwxr-xr-x root/root usr/bin/mgrtopbm
+-rwxr-xr-x root/root usr/bin/mrftopbm
+-rwxr-xr-x root/root usr/bin/mtvtoppm
+-rwxr-xr-x root/root usr/bin/neotoppm
+-rwxr-xr-x root/root usr/bin/palmtopnm
+-rwxr-xr-x root/root usr/bin/pamaddnoise
+-rwxr-xr-x root/root usr/bin/pamarith
+-rwxr-xr-x root/root usr/bin/pambackground
+-rwxr-xr-x root/root usr/bin/pambayer
+-rwxr-xr-x root/root usr/bin/pamchannel
+-rwxr-xr-x root/root usr/bin/pamcomp
+-rwxr-xr-x root/root usr/bin/pamcrater
+-rwxr-xr-x root/root usr/bin/pamcut
+-rwxr-xr-x root/root usr/bin/pamdeinterlace
+-rwxr-xr-x root/root usr/bin/pamdepth
+-rwxr-xr-x root/root usr/bin/pamdice
+-rwxr-xr-x root/root usr/bin/pamditherbw
+-rwxr-xr-x root/root usr/bin/pamedge
+-rwxr-xr-x root/root usr/bin/pamendian
+-rwxr-xr-x root/root usr/bin/pamenlarge
+-rwxr-xr-x root/root usr/bin/pamexec
+-rwxr-xr-x root/root usr/bin/pamfile
+-rwxr-xr-x root/root usr/bin/pamfix
+-rwxr-xr-x root/root usr/bin/pamfixtrunc
+-rwxr-xr-x root/root usr/bin/pamflip
+-rwxr-xr-x root/root usr/bin/pamfunc
+-rwxr-xr-x root/root usr/bin/pamgauss
+-rwxr-xr-x root/root usr/bin/pamgradient
+-rwxr-xr-x root/root usr/bin/pamlookup
+-rwxr-xr-x root/root usr/bin/pammasksharpen
+-rwxr-xr-x root/root usr/bin/pammixinterlace
+-rwxr-xr-x root/root usr/bin/pammosaicknit
+-rwxr-xr-x root/root usr/bin/pamoil
+-rwxr-xr-x root/root usr/bin/pampaintspill
+-rwxr-xr-x root/root usr/bin/pamperspective
+-rwxr-xr-x root/root usr/bin/pampick
+-rwxr-xr-x root/root usr/bin/pampop9
+-rwxr-xr-x root/root usr/bin/pamrecolor
+lrwxrwxrwx root/root usr/bin/pamrgbatopng -> pamtopng
+-rwxr-xr-x root/root usr/bin/pamrubber
+-rwxr-xr-x root/root usr/bin/pamscale
+-rwxr-xr-x root/root usr/bin/pamseq
+-rwxr-xr-x root/root usr/bin/pamshadedrelief
+-rwxr-xr-x root/root usr/bin/pamsharpmap
+-rwxr-xr-x root/root usr/bin/pamsharpness
+-rwxr-xr-x root/root usr/bin/pamsistoaglyph
+-rwxr-xr-x root/root usr/bin/pamslice
+-rwxr-xr-x root/root usr/bin/pamsplit
+-rwxr-xr-x root/root usr/bin/pamstack
+-rwxr-xr-x root/root usr/bin/pamstereogram
+-rwxr-xr-x root/root usr/bin/pamstretch
+-rwxr-xr-x root/root usr/bin/pamstretch-gen
+-rwxr-xr-x root/root usr/bin/pamsumm
+-rwxr-xr-x root/root usr/bin/pamsummcol
+-rwxr-xr-x root/root usr/bin/pamthreshold
+-rwxr-xr-x root/root usr/bin/pamtilt
+-rwxr-xr-x root/root usr/bin/pamtoavs
+-rwxr-xr-x root/root usr/bin/pamtodjvurle
+-rwxr-xr-x root/root usr/bin/pamtofits
+-rwxr-xr-x root/root usr/bin/pamtogif
+-rwxr-xr-x root/root usr/bin/pamtohdiff
+-rwxr-xr-x root/root usr/bin/pamtohtmltbl
+-rwxr-xr-x root/root usr/bin/pamtojpeg2k
+-rwxr-xr-x root/root usr/bin/pamtompfont
+-rwxr-xr-x root/root usr/bin/pamtooctaveimg
+-rwxr-xr-x root/root usr/bin/pamtopam
+-rwxr-xr-x root/root usr/bin/pamtopdbimg
+-rwxr-xr-x root/root usr/bin/pamtopfm
+-rwxr-xr-x root/root usr/bin/pamtopng
+-rwxr-xr-x root/root usr/bin/pamtopnm
+-rwxr-xr-x root/root usr/bin/pamtosrf
+-rwxr-xr-x root/root usr/bin/pamtosvg
+-rwxr-xr-x root/root usr/bin/pamtotga
+-rwxr-xr-x root/root usr/bin/pamtotiff
+-rwxr-xr-x root/root usr/bin/pamtouil
+-rwxr-xr-x root/root usr/bin/pamtowinicon
+-rwxr-xr-x root/root usr/bin/pamtoxvmini
+-rwxr-xr-x root/root usr/bin/pamundice
+-rwxr-xr-x root/root usr/bin/pamunlookup
+-rwxr-xr-x root/root usr/bin/pamvalidate
+-rwxr-xr-x root/root usr/bin/pamwipeout
+-rwxr-xr-x root/root usr/bin/pamx
+-rwxr-xr-x root/root usr/bin/pbmclean
+-rwxr-xr-x root/root usr/bin/pbmlife
+-rwxr-xr-x root/root usr/bin/pbmmake
+-rwxr-xr-x root/root usr/bin/pbmmask
+-rwxr-xr-x root/root usr/bin/pbmminkowski
+-rwxr-xr-x root/root usr/bin/pbmpage
+-rwxr-xr-x root/root usr/bin/pbmpscale
+-rwxr-xr-x root/root usr/bin/pbmreduce
+-rwxr-xr-x root/root usr/bin/pbmtext
+-rwxr-xr-x root/root usr/bin/pbmtextps
+-rwxr-xr-x root/root usr/bin/pbmto10x
+-rwxr-xr-x root/root usr/bin/pbmto4425
+-rwxr-xr-x root/root usr/bin/pbmtoascii
+-rwxr-xr-x root/root usr/bin/pbmtoatk
+-rwxr-xr-x root/root usr/bin/pbmtobbnbg
+-rwxr-xr-x root/root usr/bin/pbmtocis
+-rwxr-xr-x root/root usr/bin/pbmtocmuwm
+-rwxr-xr-x root/root usr/bin/pbmtodjvurle
+-rwxr-xr-x root/root usr/bin/pbmtoepsi
+-rwxr-xr-x root/root usr/bin/pbmtoepson
+-rwxr-xr-x root/root usr/bin/pbmtoescp2
+-rwxr-xr-x root/root usr/bin/pbmtog3
+-rwxr-xr-x root/root usr/bin/pbmtogem
+-rwxr-xr-x root/root usr/bin/pbmtogo
+-rwxr-xr-x root/root usr/bin/pbmtoibm23xx
+lrwxrwxrwx root/root usr/bin/pbmtoicon -> pbmtosunicon
+-rwxr-xr-x root/root usr/bin/pbmtolj
+-rwxr-xr-x root/root usr/bin/pbmtoln03
+-rwxr-xr-x root/root usr/bin/pbmtolps
+-rwxr-xr-x root/root usr/bin/pbmtomacp
+-rwxr-xr-x root/root usr/bin/pbmtomatrixorbital
+-rwxr-xr-x root/root usr/bin/pbmtomda
+-rwxr-xr-x root/root usr/bin/pbmtomgr
+-rwxr-xr-x root/root usr/bin/pbmtomrf
+-rwxr-xr-x root/root usr/bin/pbmtonokia
+-rwxr-xr-x root/root usr/bin/pbmtopgm
+-rwxr-xr-x root/root usr/bin/pbmtopi3
+-rwxr-xr-x root/root usr/bin/pbmtopk
+-rwxr-xr-x root/root usr/bin/pbmtoplot
+-rwxr-xr-x root/root usr/bin/pbmtoppa
+-rwxr-xr-x root/root usr/bin/pbmtopsg3
+-rwxr-xr-x root/root usr/bin/pbmtoptx
+-rwxr-xr-x root/root usr/bin/pbmtosunicon
+-rwxr-xr-x root/root usr/bin/pbmtowbmp
+-rwxr-xr-x root/root usr/bin/pbmtox10bm
+-rwxr-xr-x root/root usr/bin/pbmtoxbm
+-rwxr-xr-x root/root usr/bin/pbmtoybm
+-rwxr-xr-x root/root usr/bin/pbmtozinc
+-rwxr-xr-x root/root usr/bin/pbmupc
+-rwxr-xr-x root/root usr/bin/pc1toppm
+-rwxr-xr-x root/root usr/bin/pcdovtoppm
+-rwxr-xr-x root/root usr/bin/pcxtoppm
+-rwxr-xr-x root/root usr/bin/pdbimgtopam
+-rwxr-xr-x root/root usr/bin/pfmtopam
+-rwxr-xr-x root/root usr/bin/pgmabel
+-rwxr-xr-x root/root usr/bin/pgmbentley
+-rwxr-xr-x root/root usr/bin/pgmcrater
+-rwxr-xr-x root/root usr/bin/pgmdeshadow
+lrwxrwxrwx root/root usr/bin/pgmedge -> pamedge
+-rwxr-xr-x root/root usr/bin/pgmenhance
+-rwxr-xr-x root/root usr/bin/pgmhist
+-rwxr-xr-x root/root usr/bin/pgmkernel
+-rwxr-xr-x root/root usr/bin/pgmmake
+-rwxr-xr-x root/root usr/bin/pgmmedian
+-rwxr-xr-x root/root usr/bin/pgmminkowski
+-rwxr-xr-x root/root usr/bin/pgmmorphconv
+-rwxr-xr-x root/root usr/bin/pgmnoise
+lrwxrwxrwx root/root usr/bin/pgmnorm -> pnmnorm
+lrwxrwxrwx root/root usr/bin/pgmoil -> pamoil
+-rwxr-xr-x root/root usr/bin/pgmramp
+lrwxrwxrwx root/root usr/bin/pgmslice -> pamslice
+-rwxr-xr-x root/root usr/bin/pgmtexture
+-rwxr-xr-x root/root usr/bin/pgmtofs
+-rwxr-xr-x root/root usr/bin/pgmtolispm
+-rwxr-xr-x root/root usr/bin/pgmtopbm
+-rwxr-xr-x root/root usr/bin/pgmtopgm
+-rwxr-xr-x root/root usr/bin/pgmtoppm
+-rwxr-xr-x root/root usr/bin/pgmtosbig
+-rwxr-xr-x root/root usr/bin/pgmtost4
+-rwxr-xr-x root/root usr/bin/pi1toppm
+-rwxr-xr-x root/root usr/bin/pi3topbm
+-rwxr-xr-x root/root usr/bin/pjtoppm
+-rwxr-xr-x root/root usr/bin/pktopbm
+-rwxr-xr-x root/root usr/bin/pngtopam
+lrwxrwxrwx root/root usr/bin/pngtopnm -> pngtopam
+-rwxr-xr-x root/root usr/bin/pnmalias
+lrwxrwxrwx root/root usr/bin/pnmarith -> pamarith
+-rwxr-xr-x root/root usr/bin/pnmcat
+-rwxr-xr-x root/root usr/bin/pnmcolormap
+lrwxrwxrwx root/root usr/bin/pnmcomp -> pamcomp
+-rwxr-xr-x root/root usr/bin/pnmconvol
+-rwxr-xr-x root/root usr/bin/pnmcrop
+lrwxrwxrwx root/root usr/bin/pnmcut -> pamcut
+lrwxrwxrwx root/root usr/bin/pnmdepth -> pamdepth
+lrwxrwxrwx root/root usr/bin/pnmenlarge -> pamenlarge
+lrwxrwxrwx root/root usr/bin/pnmfile -> pamfile
+-rwxr-xr-x root/root usr/bin/pnmflip
+-rwxr-xr-x root/root usr/bin/pnmgamma
+-rwxr-xr-x root/root usr/bin/pnmhisteq
+-rwxr-xr-x root/root usr/bin/pnmhistmap
+-rwxr-xr-x root/root usr/bin/pnmindex
+lrwxrwxrwx root/root usr/bin/pnminterp -> pamstretch
+-rwxr-xr-x root/root usr/bin/pnminvert
+-rwxr-xr-x root/root usr/bin/pnmmargin
+-rwxr-xr-x root/root usr/bin/pnmmercator
+-rwxr-xr-x root/root usr/bin/pnmmontage
+-rwxr-xr-x root/root usr/bin/pnmnlfilt
+lrwxrwxrwx root/root usr/bin/pnmnoraw -> pnmtoplainpnm
+-rwxr-xr-x root/root usr/bin/pnmnorm
+-rwxr-xr-x root/root usr/bin/pnmpad
+-rwxr-xr-x root/root usr/bin/pnmpaste
+-rwxr-xr-x root/root usr/bin/pnmpsnr
+-rwxr-xr-x root/root usr/bin/pnmquant
+-rwxr-xr-x root/root usr/bin/pnmquantall
+-rwxr-xr-x root/root usr/bin/pnmremap
+-rwxr-xr-x root/root usr/bin/pnmrotate
+lrwxrwxrwx root/root usr/bin/pnmscale -> pamscale
+-rwxr-xr-x root/root usr/bin/pnmscalefixed
+-rwxr-xr-x root/root usr/bin/pnmshear
+-rwxr-xr-x root/root usr/bin/pnmsmooth
+lrwxrwxrwx root/root usr/bin/pnmsplit -> pamsplit
+-rwxr-xr-x root/root usr/bin/pnmstitch
+-rwxr-xr-x root/root usr/bin/pnmtile
+-rwxr-xr-x root/root usr/bin/pnmtoddif
+-rwxr-xr-x root/root usr/bin/pnmtofiasco
+lrwxrwxrwx root/root usr/bin/pnmtofits -> pamtofits
+-rwxr-xr-x root/root usr/bin/pnmtojbig
+-rwxr-xr-x root/root usr/bin/pnmtojpeg
+-rwxr-xr-x root/root usr/bin/pnmtopalm
+-rwxr-xr-x root/root usr/bin/pnmtopclxl
+-rwxr-xr-x root/root usr/bin/pnmtoplainpnm
+-rwxr-xr-x root/root usr/bin/pnmtopng
+lrwxrwxrwx root/root usr/bin/pnmtopnm -> pamtopnm
+-rwxr-xr-x root/root usr/bin/pnmtops
+-rwxr-xr-x root/root usr/bin/pnmtorast
+-rwxr-xr-x root/root usr/bin/pnmtorle
+-rwxr-xr-x root/root usr/bin/pnmtosgi
+-rwxr-xr-x root/root usr/bin/pnmtosir
+lrwxrwxrwx root/root usr/bin/pnmtotiff -> pamtotiff
+-rwxr-xr-x root/root usr/bin/pnmtotiffcmyk
+-rwxr-xr-x root/root usr/bin/pnmtoxwd
+-rwxr-xr-x root/root usr/bin/ppm3d
+-rwxr-xr-x root/root usr/bin/ppmbrighten
+-rwxr-xr-x root/root usr/bin/ppmchange
+-rwxr-xr-x root/root usr/bin/ppmcie
+-rwxr-xr-x root/root usr/bin/ppmcolormask
+-rwxr-xr-x root/root usr/bin/ppmcolors
+-rwxr-xr-x root/root usr/bin/ppmdcfont
+-rwxr-xr-x root/root usr/bin/ppmddumpfont
+-rwxr-xr-x root/root usr/bin/ppmdim
+-rwxr-xr-x root/root usr/bin/ppmdist
+-rwxr-xr-x root/root usr/bin/ppmdither
+-rwxr-xr-x root/root usr/bin/ppmdmkfont
+-rwxr-xr-x root/root usr/bin/ppmdraw
+-rwxr-xr-x root/root usr/bin/ppmfade
+-rwxr-xr-x root/root usr/bin/ppmflash
+-rwxr-xr-x root/root usr/bin/ppmforge
+-rwxr-xr-x root/root usr/bin/ppmglobe
+-rwxr-xr-x root/root usr/bin/ppmhist
+-rwxr-xr-x root/root usr/bin/ppmlabel
+-rwxr-xr-x root/root usr/bin/ppmmake
+-rwxr-xr-x root/root usr/bin/ppmmix
+lrwxrwxrwx root/root usr/bin/ppmnorm -> pnmnorm
+-rwxr-xr-x root/root usr/bin/ppmntsc
+-rwxr-xr-x root/root usr/bin/ppmpat
+-rwxr-xr-x root/root usr/bin/ppmquant
+lrwxrwxrwx root/root usr/bin/ppmquantall -> pnmquantall
+-rwxr-xr-x root/root usr/bin/ppmrainbow
+-rwxr-xr-x root/root usr/bin/ppmrelief
+-rwxr-xr-x root/root usr/bin/ppmrough
+-rwxr-xr-x root/root usr/bin/ppmshadow
+-rwxr-xr-x root/root usr/bin/ppmshift
+-rwxr-xr-x root/root usr/bin/ppmspread
+-rwxr-xr-x root/root usr/bin/ppmtoacad
+-rwxr-xr-x root/root usr/bin/ppmtoapplevol
+-rwxr-xr-x root/root usr/bin/ppmtoarbtxt
+-rwxr-xr-x root/root usr/bin/ppmtoascii
+-rwxr-xr-x root/root usr/bin/ppmtobmp
+-rwxr-xr-x root/root usr/bin/ppmtoeyuv
+-rwxr-xr-x root/root usr/bin/ppmtogif
+-rwxr-xr-x root/root usr/bin/ppmtoicr
+-rwxr-xr-x root/root usr/bin/ppmtoilbm
+lrwxrwxrwx root/root usr/bin/ppmtojpeg -> pnmtojpeg
+-rwxr-xr-x root/root usr/bin/ppmtoleaf
+-rwxr-xr-x root/root usr/bin/ppmtolj
+-rwxr-xr-x root/root usr/bin/ppmtomap
+-rwxr-xr-x root/root usr/bin/ppmtomitsu
+-rwxr-xr-x root/root usr/bin/ppmtompeg
+-rwxr-xr-x root/root usr/bin/ppmtoneo
+-rwxr-xr-x root/root usr/bin/ppmtopcx
+-rwxr-xr-x root/root usr/bin/ppmtopgm
+-rwxr-xr-x root/root usr/bin/ppmtopi1
+-rwxr-xr-x root/root usr/bin/ppmtopict
+-rwxr-xr-x root/root usr/bin/ppmtopj
+-rwxr-xr-x root/root usr/bin/ppmtopjxl
+-rwxr-xr-x root/root usr/bin/ppmtoppm
+-rwxr-xr-x root/root usr/bin/ppmtopuzz
+-rwxr-xr-x root/root usr/bin/ppmtorgb3
+-rwxr-xr-x root/root usr/bin/ppmtosixel
+-rwxr-xr-x root/root usr/bin/ppmtospu
+-rwxr-xr-x root/root usr/bin/ppmtoterm
+lrwxrwxrwx root/root usr/bin/ppmtotga -> pamtotga
+lrwxrwxrwx root/root usr/bin/ppmtouil -> pamtouil
+-rwxr-xr-x root/root usr/bin/ppmtowinicon
+-rwxr-xr-x root/root usr/bin/ppmtoxpm
+-rwxr-xr-x root/root usr/bin/ppmtoyuv
+-rwxr-xr-x root/root usr/bin/ppmtoyuvsplit
+-rwxr-xr-x root/root usr/bin/ppmtv
+-rwxr-xr-x root/root usr/bin/ppmwheel
+-rwxr-xr-x root/root usr/bin/psidtopgm
+-rwxr-xr-x root/root usr/bin/pstopnm
+-rwxr-xr-x root/root usr/bin/qrttoppm
+-rwxr-xr-x root/root usr/bin/rasttopnm
+-rwxr-xr-x root/root usr/bin/rawtopgm
+-rwxr-xr-x root/root usr/bin/rawtoppm
+-rwxr-xr-x root/root usr/bin/rgb3toppm
+-rwxr-xr-x root/root usr/bin/rlatopam
+-rwxr-xr-x root/root usr/bin/rletopnm
+-rwxr-xr-x root/root usr/bin/sbigtopgm
+-rwxr-xr-x root/root usr/bin/sgitopnm
+-rwxr-xr-x root/root usr/bin/sirtopnm
+-rwxr-xr-x root/root usr/bin/sldtoppm
+-rwxr-xr-x root/root usr/bin/spctoppm
+-rwxr-xr-x root/root usr/bin/spottopgm
+-rwxr-xr-x root/root usr/bin/sputoppm
+-rwxr-xr-x root/root usr/bin/srftopam
+-rwxr-xr-x root/root usr/bin/st4topgm
+-rwxr-xr-x root/root usr/bin/sunicontopnm
+-rwxr-xr-x root/root usr/bin/svgtopam
+-rwxr-xr-x root/root usr/bin/tgatoppm
+-rwxr-xr-x root/root usr/bin/thinkjettopbm
+-rwxr-xr-x root/root usr/bin/tifftopnm
+-rwxr-xr-x root/root usr/bin/wbmptopbm
+-rwxr-xr-x root/root usr/bin/winicontopam
+-rwxr-xr-x root/root usr/bin/winicontoppm
+-rwxr-xr-x root/root usr/bin/xbmtopbm
+-rwxr-xr-x root/root usr/bin/ximtoppm
+-rwxr-xr-x root/root usr/bin/xpmtoppm
+-rwxr-xr-x root/root usr/bin/xvminitoppm
+-rwxr-xr-x root/root usr/bin/xwdtopnm
+-rwxr-xr-x root/root usr/bin/ybmtopbm
+-rwxr-xr-x root/root usr/bin/yuvsplittoppm
+-rwxr-xr-x root/root usr/bin/yuvtoppm
+-rwxr-xr-x root/root usr/bin/yuy2topam
+-rwxr-xr-x root/root usr/bin/zeisstopnm
+drwxr-xr-x root/root usr/include/
+drwxr-xr-x root/root usr/include/netpbm/
+-rw-r--r-- root/root usr/include/netpbm/colorname.h
+-rw-r--r-- root/root usr/include/netpbm/mallocvar.h
+-rw-r--r-- root/root usr/include/netpbm/pam.h
+-rw-r--r-- root/root usr/include/netpbm/pamdraw.h
+-rw-r--r-- root/root usr/include/netpbm/pammap.h
+-rw-r--r-- root/root usr/include/netpbm/pbm.h
+-rw-r--r-- root/root usr/include/netpbm/pbmfont.h
+-rw-r--r-- root/root usr/include/netpbm/pgm.h
+-rw-r--r-- root/root usr/include/netpbm/pm.h
+-rw-r--r-- root/root usr/include/netpbm/pm_config.h
+-rw-r--r-- root/root usr/include/netpbm/pm_gamma.h
+-rw-r--r-- root/root usr/include/netpbm/pm_system.h
+-rw-r--r-- root/root usr/include/netpbm/pnm.h
+-rw-r--r-- root/root usr/include/netpbm/ppm.h
+-rw-r--r-- root/root usr/include/netpbm/ppmcmap.h
+-rw-r--r-- root/root usr/include/netpbm/ppmdfont.h
+-rw-r--r-- root/root usr/include/netpbm/ppmdraw.h
+-rw-r--r-- root/root usr/include/netpbm/ppmfloyd.h
+-rw-r--r-- root/root usr/include/netpbm/runlength.h
+-rw-r--r-- root/root usr/include/netpbm/shhopt.h
+drwxr-xr-x root/root usr/lib/
+-rw-r--r-- root/root usr/lib/libnetpbm.a
+lrwxrwxrwx root/root usr/lib/libnetpbm.so -> ../lib/libnetpbm.so.11
+lrwxrwxrwx root/root usr/lib/libnetpbm.so.11 -> libnetpbm.so.11.73
+-rwxr-xr-x root/root usr/lib/libnetpbm.so.11.73
+drwxr-xr-x root/root usr/share/
+drwxr-xr-x root/root usr/share/licenses/
+drwxr-xr-x root/root usr/share/licenses/netpbm/
+-rw-r--r-- root/root usr/share/licenses/netpbm/copyright_summary.txt
+drwxr-xr-x root/root usr/share/man/
+drwxr-xr-x root/root usr/share/man/man1/
+-rw-r--r-- root/root usr/share/man/man1/411toppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/anytopnm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/asciitopgm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/atktopbm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/bioradtopgm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/bmptopnm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/bmptoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/brushtopbm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/cameratopam.1.gz
+-rw-r--r-- root/root usr/share/man/man1/cmuwmtopbm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ddbugtopbm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/escp2topbm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/eyuvtoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/fiascotopnm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/fitstopnm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/fstopgm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/g3topbm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/gemtopbm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/gemtopnm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/giftopnm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/gouldtoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/hdifftopam.1.gz
+-rw-r--r-- root/root usr/share/man/man1/hipstopgm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/hpcdtoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/icontopbm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ilbmtoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/imgtoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/infotopam.1.gz
+-rw-r--r-- root/root usr/share/man/man1/jbigtopnm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/jpeg2ktopam.1.gz
+-rw-r--r-- root/root usr/share/man/man1/jpegtopnm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/leaftoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/lispmtopgm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/macptopbm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/manweb.1.gz
+-rw-r--r-- root/root usr/share/man/man1/mdatopbm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/mgrtopbm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/mrf.1.gz
+-rw-r--r-- root/root usr/share/man/man1/mrftopbm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/mtvtoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/neotoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/netpbm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/palmtopnm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamaddnoise.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamarith.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pambackground.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pambayer.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamchannel.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamcomp.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamcut.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamdeinterlace.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamdepth.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamdice.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamditherbw.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamedge.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamendian.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamenlarge.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamfile.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamfixtrunc.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamflip.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamfunc.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamgauss.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamgradient.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamlookup.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pammasksharpen.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pammixinterlace.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamoil.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamperspective.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pampick.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pampop9.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamrgbatopng.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamscale.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamseq.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamsharpmap.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamsharpness.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamslice.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamsplit.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamstack.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamstereogram.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamstretch-gen.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamstretch.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamsumm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamsummcol.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamthreshold.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamtilt.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamtodjvurle.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamtofits.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamtogif.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamtohdiff.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamtohtmltbl.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamtojpeg2k.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamtopfm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamtopnm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamtosvg.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamtotga.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamtotiff.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamtouil.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamtoxvmini.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pamx.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmclean.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmlife.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmmake.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmmask.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmpage.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmpscale.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmreduce.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtext.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtextps.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmto10x.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmto4425.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtoascii.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtoatk.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtobbnbg.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtocmuwm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtodjvurle.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtoepsi.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtoepson.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtoescp2.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtog3.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtogem.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtogo.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtoibm23xx.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtoicon.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtolj.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtoln03.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtolps.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtomacp.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtomatrixorbital.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtomda.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtomgr.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtomrf.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtonokia.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtopgm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtopi3.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtopk.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtoplot.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtoppa.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtopsg3.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtoptx.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtowbmp.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtox10bm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtoxbm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtoybm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmtozinc.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pbmupc.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pc1toppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pcdovtoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pcxtoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pfmtopam.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pgmabel.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pgmbentley.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pgmcrater.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pgmdeshadow.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pgmedge.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pgmenhance.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pgmhist.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pgmkernel.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pgmmake.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pgmmedian.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pgmminkowski.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pgmmorphconv.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pgmnoise.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pgmnorm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pgmoil.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pgmramp.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pgmslice.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pgmtexture.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pgmtofs.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pgmtolispm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pgmtopbm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pgmtopgm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pgmtoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pi1toppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pi3topbm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/picttoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pjtoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pktopbm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pngtopnm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmalias.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmarith.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmcat.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmcolormap.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmcomp.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmconvol.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmcrop.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmcut.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmdepth.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmenlarge.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmfile.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmgamma.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmhisteq.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmhistmap.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmindex.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnminterp.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnminvert.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmmargin.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmmontage.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmnlfilt.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmnoraw.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmnorm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmpad.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmpaste.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmpsnr.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmquant.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmremap.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmrotate.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmscale.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmscalefixed.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmshear.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmsmooth.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmsplit.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmstitch.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmtile.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmtoddif.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmtofiasco.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmtofits.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmtojbig.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmtojpeg.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmtopalm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmtopclxl.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmtoplainpnm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmtopng.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmtopnm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmtops.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmtorast.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmtorle.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmtosgi.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmtosir.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmtotiff.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmtotiffcmyk.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pnmtoxwd.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppm3d.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmbrighten.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmchange.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmcie.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmcolormask.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmdcfont.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmddumpfont.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmdim.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmdist.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmdither.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmdmkfont.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmdraw.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmfade.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmflash.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmforge.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmglobe.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmhist.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmlabel.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmmake.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmmix.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmnorm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmntsc.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmpat.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmquant.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmquantall.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmrainbow.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmrelief.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmrough.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmshadow.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmshift.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmspread.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmsvgalib.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtoacad.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtoarbtxt.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtobmp.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtoeyuv.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtoicr.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtoilbm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtojpeg.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtoleaf.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtolj.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtomap.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtomitsu.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtompeg.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtoneo.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtopcx.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtopgm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtopi1.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtopict.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtopj.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtopjxl.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtopuzz.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtorgb3.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtosixel.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtoterm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtotga.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtouil.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtowinicon.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtoxpm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtoyuv.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtoyuvsplit.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmtv.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ppmwheel.1.gz
+-rw-r--r-- root/root usr/share/man/man1/psidtopgm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/pstopnm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/qrttoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/rasttopnm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/rawtopgm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/rawtoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/rgb3toppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/rlatopam.1.gz
+-rw-r--r-- root/root usr/share/man/man1/rletopnm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/sbigtopgm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/sgitopnm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/sirtopnm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/sldtoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/spctoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/spottopgm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/sputoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/tgatoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/thinkjettopbm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/tifftopnm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/vidtoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/wbmptopbm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/winicontoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/xbmtopbm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ximtoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/xpmtoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/xvminitoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/xwdtopnm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ybmtopbm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/yuvsplittoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/yuvtoppm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/zeisstopnm.1.gz
+drwxr-xr-x root/root usr/share/man/man3/
+-rw-r--r-- root/root usr/share/man/man3/libnetpbm.3.gz
+-rw-r--r-- root/root usr/share/man/man3/libnetpbm_image.3.gz
+-rw-r--r-- root/root usr/share/man/man3/libnetpbm_ug.3.gz
+-rw-r--r-- root/root usr/share/man/man3/libpbm.3.gz
+-rw-r--r-- root/root usr/share/man/man3/libpgm.3.gz
+-rw-r--r-- root/root usr/share/man/man3/libpm.3.gz
+-rw-r--r-- root/root usr/share/man/man3/libpnm.3.gz
+-rw-r--r-- root/root usr/share/man/man3/libppm.3.gz
+-rw-r--r-- root/root usr/share/man/man3/libsystem.3.gz
+-rw-r--r-- root/root usr/share/man/man3/libtmpfile.3.gz
+drwxr-xr-x root/root usr/share/man/man5/
+-rw-r--r-- root/root usr/share/man/man5/extendedopacity.5.gz
+-rw-r--r-- root/root usr/share/man/man5/pam.5.gz
+-rw-r--r-- root/root usr/share/man/man5/pbm.5.gz
+-rw-r--r-- root/root usr/share/man/man5/pfm.5.gz
+-rw-r--r-- root/root usr/share/man/man5/pgm.5.gz
+-rw-r--r-- root/root usr/share/man/man5/pnm.5.gz
+-rw-r--r-- root/root usr/share/man/man5/ppm.5.gz
+drwxr-xr-x root/root usr/share/netpbm/
+-rw-r--r-- root/root usr/share/netpbm/palmcolor8.map
+-rw-r--r-- root/root usr/share/netpbm/palmgray1.map
+-rw-r--r-- root/root usr/share/netpbm/palmgray2.map
+-rw-r--r-- root/root usr/share/netpbm/palmgray4.map
+-rw-r--r-- root/root usr/share/netpbm/pcxstd.ppm
+-rw-r--r-- root/root usr/share/netpbm/rgb.txt
diff --git a/manualPorts/netpbm/.md5sum b/manualPorts/netpbm/.md5sum
new file mode 100644
index 0000000..8bf5b8a
--- /dev/null
+++ b/manualPorts/netpbm/.md5sum
@@ -0,0 +1,8 @@
+c566fc35d34f3de4d8e41a578bc3a898 netpbm-10.73.32.tgz
+914e2b00571ee925a73f3864251b9b59 netpbm-CAN-2005-2471.patch
+5077d676c2c771a288811b06c39afeae netpbm-doc-31Jan2014.tar.xz
+894a6b411a7861aec2c9a413be18d4f7 netpbm-doc-31Jan2014.tar.xz.sig
+2864c441c717b7fbe01511dbafe67b2c netpbm-security-code.patch
+31b30be6cbf98dd79436db2b85b969d6 netpbm-security-scripts.patch
+e201fba27e54c32ab121bd7f191653d2 reproducible-man-gzip.patch
+820c4f830a0812fbb2ad043548bc0c94 use-source-date-epoch.patch
diff --git a/manualPorts/netpbm/.signature b/manualPorts/netpbm/.signature
new file mode 100644
index 0000000..b3c8ad9
--- /dev/null
+++ b/manualPorts/netpbm/.signature
@@ -0,0 +1,12 @@
+untrusted comment: verify with /etc/ports/deepthought.pub
+RWQxCptPusLGGto0ntCNZ51sYJfpeUFZ6xNvCOYW5i9uFoCTPZQ1TgT9XbjPqEI1wOUu71QWpX4UXxOeZEUg9+9M98O8cQ6Pogs=
+SHA256 (Pkgfile) = eee42a7acc22dbc97cf2322151dcc7add8fad756e433be5e079cbe22f3e3d03e
+SHA256 (.footprint) = 7f1795199040c82ab2d6dd8ca8be2f1cdf90e1c00baa3b65a05c8799075d752c
+SHA256 (netpbm-10.73.32.tgz) = a79b86a9ff28bac4fa46688a6cb6e537be0129d23fc74ec71a941b0791679942
+SHA256 (netpbm-doc-31Jan2014.tar.xz) = 74bcf840ee643c6917330c382484010cb99c004a3fcf05391bebcac63815acb3
+SHA256 (netpbm-doc-31Jan2014.tar.xz.sig) = 9313d3001433c66014fd4be21c853ded915d81b6085e342b13d91b8909bd3ff1
+SHA256 (netpbm-CAN-2005-2471.patch) = 991aba7897e0710687369b4e2edfba1397ecd77d62578eac496afbc47b5ca970
+SHA256 (netpbm-security-code.patch) = 83d75a80ce999d8b69572e54f04c4d220c60b0d09f9e52d3236264535c3bf216
+SHA256 (netpbm-security-scripts.patch) = 2c397588d9cba2c40dee55c07713d5e77e0e04245db939fdc1962d7de4cf4a33
+SHA256 (reproducible-man-gzip.patch) = 8e3efdb4fcbfdc8e9a5c8e9663c7d6b9ecef3a2379ce38d2acc5669c339f6814
+SHA256 (use-source-date-epoch.patch) = 68055341833f482c6910a56c2fdfe046978a1a92fd8442a2a9209c82ce3e4d13
diff --git a/manualPorts/netpbm/Pkgfile b/manualPorts/netpbm/Pkgfile
new file mode 100644
index 0000000..e92fdfe
--- /dev/null
+++ b/manualPorts/netpbm/Pkgfile
@@ -0,0 +1,55 @@
+# Description: A toolkit for manipulation of graphic images.
+# URL: http://netpbm.sourceforge.net/
+# Maintainer: Erich Eckner, crux at eckner dot net
+# Depends on: perl libpng libtiff libxml2 python jbigkit subversion
+
+name=netpbm
+version=10.73.32
+release=1
+source=(https://downloads.sourceforge.net/project/netpbm/super_stable/$version/netpbm-$version.tgz
+ https://sources.archlinux.org/other/packages/netpbm/netpbm-doc-31Jan2014.tar.xz{,.sig}
+ netpbm-CAN-2005-2471.patch netpbm-security-code.patch netpbm-security-scripts.patch
+ reproducible-man-gzip.patch use-source-date-epoch.patch)
+
+build() {
+ cd $name-$version
+
+ patch -p1 < ../netpbm-CAN-2005-2471.patch
+ patch -p1 < ../netpbm-security-code.patch
+ patch -p1 < ../netpbm-security-scripts.patch
+ patch -p1 < ../reproducible-man-gzip.patch
+ patch -p1 < ../use-source-date-epoch.patch
+
+ cp config.mk.in config.mk
+ echo 'CFLAGS_SHLIB = -fPIC' >> config.mk
+ echo "NETPBM_DOCURL = file://${SRC}/doc" >> config.mk
+ echo 'TIFFLIB = libtiff.so' >> config.mk
+ echo 'JPEGLIB = libjpeg.so' >> config.mk
+ echo 'PNGLIB = libpng.so' >> config.mk
+ echo 'ZLIB = libz.so' >> config.mk
+ echo 'JBIGLIB = /usr/lib/libjbig.a' >> config.mk
+
+ sed -i 's|misc|share/netpbm|' common.mk
+ sed -i 's|/link|/lib|' lib/Makefile
+ sed -i 's|install.manwebmain install.manweb install.man|install.man|' GNUmakefile
+
+ make
+ # Generating useful man pages with html doc
+ make MAKEMAN="${SRC}/$name-$version/buildtools/makeman" USERGUIDE=. \
+ -C ../doc -f "${SRC}/$name-$version/buildtools/manpage.mk" manpages
+
+ make pkgdir="${PKG}/usr" PKGMANDIR=share/man install-run install-dev
+
+# Removing dummy man pages
+ rm "${PKG}"/usr/share/man/man{1,3,5}/*
+
+ make MAKEMAN="${SRC}/$name-$version/buildtools/makeman" MANDIR="${PKG}/usr/share/man" \
+ -C ../doc -f "${SRC}/$name-$version/buildtools/manpage.mk" installman
+
+# Replace obsolete utility
+ echo -e '#!/bin/sh\npamditherbw $@ | pamtopnm\n' > "${PKG}/usr/bin/pgmtopbm"
+
+# Licensing. Note that each program in the package has a separate license.
+ install -D -m644 "${SRC}/$name-$version/doc/copyright_summary" \
+ "${PKG}/usr/share/licenses/${name}/copyright_summary.txt"
+}
diff --git a/manualPorts/netpbm/netpbm-CAN-2005-2471.patch b/manualPorts/netpbm/netpbm-CAN-2005-2471.patch
new file mode 100644
index 0000000..e4e9373
--- /dev/null
+++ b/manualPorts/netpbm/netpbm-CAN-2005-2471.patch
@@ -0,0 +1,16 @@
+--- netpbm-10.29/converter/other/pstopnm.c.CAN-2005-2471 2005-08-15 02:39:46.000000000 +0200
++++ netpbm-10.29/converter/other/pstopnm.c 2005-08-16 15:38:15.000000000 +0200
+@@ -818,11 +818,11 @@
+ ghostscriptProg, arg0,
+ deviceopt, outfileopt, gopt, ropt, textalphabitsopt,
+ "-q", "-dNOPAUSE",
+- "-dSAFER", "-");
++ "-dPARANOIDSAFER", "-");
+ }
+
+ execl(ghostscriptProg, arg0, deviceopt, outfileopt, gopt, ropt,
+- textalphabitsopt, "-q", "-dNOPAUSE", "-dSAFER", "-", NULL);
++ textalphabitsopt, "-q", "-dNOPAUSE", "-dPARANOIDSAFER", "-", NULL);
+
+ pm_error("execl() of Ghostscript ('%s') failed, errno=%d (%s)",
+ ghostscriptProg, errno, strerror(errno));
diff --git a/manualPorts/netpbm/netpbm-security-code.patch b/manualPorts/netpbm/netpbm-security-code.patch
new file mode 100644
index 0000000..8674eb7
--- /dev/null
+++ b/manualPorts/netpbm/netpbm-security-code.patch
@@ -0,0 +1,1432 @@
+diff --git a/analyzer/pgmtexture.c b/analyzer/pgmtexture.c
+index 0731733..635c58b 100644
+--- a/analyzer/pgmtexture.c
++++ b/analyzer/pgmtexture.c
+@@ -98,6 +98,8 @@ vector(unsigned int const nl,
+
+ assert(nh >= nl);
+
++ overflow_add(nh - nl, 1);
++
+ MALLOCARRAY(v, (unsigned) (nh - nl + 1));
+
+ if (v == NULL)
+@@ -129,6 +131,7 @@ matrix (unsigned int const nrl,
+ assert(nrh >= nrl);
+
+ /* allocate pointers to rows */
++ overflow_add(nrh - nrl, 1);
+ MALLOCARRAY(m, (unsigned) (nrh - nrl + 1));
+ if (m == NULL)
+ pm_error("Unable to allocate memory for a matrix.");
+@@ -137,6 +140,7 @@ matrix (unsigned int const nrl,
+
+ assert (nch >= ncl);
+
++ overflow_add(nch - ncl, 1);
+ /* allocate rows and set pointers to them */
+ for (i = nrl; i <= nrh; ++i) {
+ MALLOCARRAY(m[i], (unsigned) (nch - ncl + 1));
+diff --git a/converter/other/gemtopnm.c b/converter/other/gemtopnm.c
+index aac7479..5f1a51a 100644
+--- a/converter/other/gemtopnm.c
++++ b/converter/other/gemtopnm.c
+@@ -106,6 +106,7 @@ main(argc, argv)
+
+ pnm_writepnminit( stdout, cols, rows, MAXVAL, type, 0 );
+
++ overflow_add(cols, padright);
+ {
+ /* allocate input row data structure */
+ int plane;
+diff --git a/converter/other/jpegtopnm.c b/converter/other/jpegtopnm.c
+index ab3b18e..c324b86 100644
+--- a/converter/other/jpegtopnm.c
++++ b/converter/other/jpegtopnm.c
+@@ -861,6 +861,8 @@ convertImage(FILE * const ofP,
+ /* Calculate output image dimensions so we can allocate space */
+ jpeg_calc_output_dimensions(cinfoP);
+
++ overflow2(cinfoP->output_width, cinfoP->output_components);
++
+ /* Start decompressor */
+ jpeg_start_decompress(cinfoP);
+
+diff --git a/converter/other/pbmtopgm.c b/converter/other/pbmtopgm.c
+index 69b20fb..382a487 100644
+--- a/converter/other/pbmtopgm.c
++++ b/converter/other/pbmtopgm.c
+@@ -47,6 +47,7 @@ main(int argc, char *argv[]) {
+ "than the image height (%u rows)", height, rows);
+
+ outrow = pgm_allocrow(cols) ;
++ overflow2(width, height);
+ maxval = MIN(PGM_OVERALLMAXVAL, width*height);
+ pgm_writepgminit(stdout, cols, rows, maxval, 0) ;
+
+diff --git a/converter/other/pnmtoddif.c b/converter/other/pnmtoddif.c
+index ae8c852..9ee037b 100644
+--- a/converter/other/pnmtoddif.c
++++ b/converter/other/pnmtoddif.c
+@@ -632,6 +632,7 @@ main(int argc, char *argv[]) {
+ switch (PNM_FORMAT_TYPE(format)) {
+ case PBM_TYPE:
+ ip.bits_per_pixel = 1;
++ overflow_add(cols, 7);
+ ip.bytes_per_line = (cols + 7) / 8;
+ ip.spectral = 2;
+ ip.components = 1;
+@@ -647,6 +648,7 @@ main(int argc, char *argv[]) {
+ ip.polarity = 2;
+ break;
+ case PPM_TYPE:
++ overflow2(cols, 3);
+ ip.bytes_per_line = 3 * cols;
+ ip.bits_per_pixel = 24;
+ ip.spectral = 5;
+diff --git a/converter/other/pnmtojpeg.c b/converter/other/pnmtojpeg.c
+index ce231c9..1279040 100644
+--- a/converter/other/pnmtojpeg.c
++++ b/converter/other/pnmtojpeg.c
+@@ -605,7 +605,11 @@ read_scan_script(j_compress_ptr const cinfo,
+ want JPOOL_PERMANENT.
+ */
+ const unsigned int scan_info_size = nscans * sizeof(jpeg_scan_info);
+- jpeg_scan_info * const scan_info =
++ const jpeg_scan_info * scan_info;
++
++ overflow2(nscans, sizeof(jpeg_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 rescale_p, const pixval maxval,
+ const long half_maxval = maxval / 2;
+ long val;
+
++ overflow_add(maxval, 1);
++ overflow2(maxval+1, sizeof(JSAMPLE));
+ *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_struct * const cinfo_p,
+ */
+
+ /* Allocate the libpnm output and compressor input buffers */
++ overflow2(cinfo_p->image_width, cinfo_p->input_components);
+ buffer = (*cinfo_p->mem->alloc_sarray)
+ ((j_common_ptr) cinfo_p, JPOOL_IMAGE,
+ (unsigned int) cinfo_p->image_width * cinfo_p->input_components,
+diff --git a/converter/other/pnmtops.c b/converter/other/pnmtops.c
+index 6cd6be9..8a7d25a 100644
+--- a/converter/other/pnmtops.c
++++ b/converter/other/pnmtops.c
+@@ -292,17 +292,21 @@ parseCommandLine(int argc, const char ** argv,
+ validateCompDimension(width, 72, "-width value");
+ validateCompDimension(height, 72, "-height value");
+
++ 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(imagewidth, 72, "-imageheight value");
++ validateCompDimension(imageheight, 72, "-imageheight value");
++ overflow2(imageheight, 72);
+ cmdlineP->imageheight = imageheight * 72;
+ }
+ else
+diff --git a/converter/other/rletopnm.c b/converter/other/rletopnm.c
+index 9995914..058278c 100644
+--- a/converter/other/rletopnm.c
++++ b/converter/other/rletopnm.c
+@@ -19,6 +19,8 @@
+ * If you modify this software, you should include a notice giving the
+ * name of the person performing the modification, the date of modification,
+ * and the reason for such modification.
++ *
++ * 2002-12-19: Fix maths wrapping bugs. Alan Cox <alan@redhat.com>
+ */
+ /*
+ * rletopnm - A conversion program to convert from Utah's "rle" image format
+diff --git a/converter/other/sirtopnm.c b/converter/other/sirtopnm.c
+index fafcc91..9fe49d0 100644
+--- a/converter/other/sirtopnm.c
++++ b/converter/other/sirtopnm.c
+@@ -69,6 +69,7 @@ char* argv[];
+ }
+ break;
+ case PPM_TYPE:
++ overflow3(cols, rows, 3);
+ picsize = cols * rows * 3;
+ planesize = cols * rows;
+ if ( !( sirarray = (unsigned char*) malloc( picsize ) ) )
+diff --git a/converter/other/tifftopnm.c b/converter/other/tifftopnm.c
+index 0d6494f..19e9e38 100644
+--- a/converter/other/tifftopnm.c
++++ b/converter/other/tifftopnm.c
+@@ -1309,7 +1309,9 @@ convertRasterByRows(pnmOut * const pnmOutP,
+ if (scanbuf == NULL)
+ pm_error("can't allocate memory for scanline buffer");
+
+- MALLOCARRAY(samplebuf, cols * spp);
++ /* samplebuf is unsigned int * !!! */
++ samplebuf = (unsigned int *) malloc3(cols , sizeof(unsigned int) , spp);
++
+ if (samplebuf == NULL)
+ pm_error("can't allocate memory for row buffer");
+
+diff --git a/converter/other/xwdtopnm.c b/converter/other/xwdtopnm.c
+index 45d66b4..c914481 100644
+--- a/converter/other/xwdtopnm.c
++++ b/converter/other/xwdtopnm.c
+@@ -209,6 +209,10 @@ processX10Header(X10WDFileHeader * const h10P,
+ *colorsP = pnm_allocrow(2);
+ PNM_ASSIGN1((*colorsP)[0], 0);
+ PNM_ASSIGN1((*colorsP)[1], *maxvalP);
++ overflow_add(h10P->pixmap_width, 15);
++ if(h10P->pixmap_width < 0)
++ pm_error("assert: negative width");
++ overflow2((((h10P->pixmap_width + 15) / 16) * 16 - h10P->pixmap_width), 8);
+ *padrightP =
+ (((h10P->pixmap_width + 15) / 16) * 16 - h10P->pixmap_width) * 8;
+ *bits_per_itemP = 16;
+@@ -634,6 +638,7 @@ processX11Header(X11WDFileHeader * const h11P,
+
+ *colsP = h11FixedP->pixmap_width;
+ *rowsP = h11FixedP->pixmap_height;
++ overflow2(h11FixedP->bytes_per_line, 8);
+ *padrightP =
+ h11FixedP->bytes_per_line * 8 -
+ h11FixedP->pixmap_width * h11FixedP->bits_per_pixel;
+diff --git a/converter/pbm/mdatopbm.c b/converter/pbm/mdatopbm.c
+index d8e0657..12c7468 100644
+--- a/converter/pbm/mdatopbm.c
++++ b/converter/pbm/mdatopbm.c
+@@ -245,10 +245,13 @@ main(int argc, char **argv) {
+ pm_readlittleshort(infile, &yy); nInCols = yy;
+ }
+
++ overflow2(nOutCols, 8);
+ nOutCols = 8 * nInCols;
+ nOutRows = nInRows;
+- if (bScale)
++ if (bScale) {
++ overflow2(nOutRows, 2);
+ nOutRows *= 2;
++ }
+
+ data = pbm_allocarray(nOutCols, nOutRows);
+
+diff --git a/converter/pbm/mgrtopbm.c b/converter/pbm/mgrtopbm.c
+index 9f7004a..60e8477 100644
+--- a/converter/pbm/mgrtopbm.c
++++ b/converter/pbm/mgrtopbm.c
+@@ -65,6 +65,8 @@ readMgrHeader(FILE * const ifP,
+ if (head.h_high < ' ' || head.l_high < ' ')
+ pm_error("Invalid width field in MGR header");
+
++ overflow_add(*colsP, pad);
++
+ *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 --git a/converter/pbm/pbmto4425.c b/converter/pbm/pbmto4425.c
+index 1d97ac6..c4c8cbb 100644
+--- a/converter/pbm/pbmto4425.c
++++ b/converter/pbm/pbmto4425.c
+@@ -2,6 +2,7 @@
+
+ #include "nstring.h"
+ #include "pbm.h"
++#include <string.h>
+
+ static char bit_table[2][3] = {
+ {1, 4, 0x10},
+@@ -160,7 +161,7 @@ main(int argc, char * argv[]) {
+ xres = vmap_width * 2;
+ yres = vmap_height * 3;
+
+- vmap = malloc(vmap_width * vmap_height * sizeof(char));
++ vmap = malloc3(vmap_width, vmap_height, sizeof(char));
+ if(vmap == NULL)
+ {
+ pm_error( "Cannot allocate memory" );
+diff --git a/converter/pbm/pbmtogem.c b/converter/pbm/pbmtogem.c
+index 9eab041..13b0257 100644
+--- a/converter/pbm/pbmtogem.c
++++ b/converter/pbm/pbmtogem.c
+@@ -79,6 +79,7 @@ putinit (int const rows, int const cols)
+ bitsperitem = 0;
+ bitshift = 7;
+ outcol = 0;
++ overflow_add(cols, 7);
+ outmax = (cols + 7) / 8;
+ outrow = (unsigned char *) pm_allocrow (outmax, sizeof (unsigned char));
+ lastrow = (unsigned char *) pm_allocrow (outmax, sizeof (unsigned char));
+diff --git a/converter/pbm/pbmtogo.c b/converter/pbm/pbmtogo.c
+index 23b2ee9..d2ee91f 100644
+--- a/converter/pbm/pbmtogo.c
++++ b/converter/pbm/pbmtogo.c
+@@ -158,6 +158,7 @@ main(int argc,
+ bitrow = pbm_allocrow(cols);
+
+ /* Round cols up to the nearest multiple of 8. */
++ overflow_add(cols, 7);
+ rucols = ( cols + 7 ) / 8;
+ bytesperrow = rucols; /* GraphOn uses bytes */
+ rucols = rucols * 8;
+diff --git a/converter/pbm/pbmtolj.c b/converter/pbm/pbmtolj.c
+index 0cceb4f..fdab6df 100644
+--- a/converter/pbm/pbmtolj.c
++++ b/converter/pbm/pbmtolj.c
+@@ -120,7 +120,11 @@ parseCommandLine(int argc, char ** argv,
+ static void
+ allocateBuffers(unsigned int const cols) {
+
++ overflow_add(cols, 8);
+ rowBufferSize = (cols + 7) / 8;
++ overflow_add(rowBufferSize, 128);
++ overflow_add(rowBufferSize, rowBufferSize+128);
++ overflow_add(rowBufferSize+10, rowBufferSize/8);
+ packBufferSize = rowBufferSize + (rowBufferSize + 127) / 128 + 1;
+ deltaBufferSize = rowBufferSize + rowBufferSize / 8 + 10;
+
+diff --git a/converter/pbm/pbmtomda.c b/converter/pbm/pbmtomda.c
+index 3ad5149..9efe5cf 100644
+--- a/converter/pbm/pbmtomda.c
++++ b/converter/pbm/pbmtomda.c
+@@ -179,6 +179,7 @@ int main(int argc, char **argv)
+
+ nOutRowsUnrounded = bScale ? nInRows/2 : nInRows;
+
++ overflow_add(nOutRowsUnrounded, 3);
+ nOutRows = ((nOutRowsUnrounded + 3) / 4) * 4;
+ /* MDA wants rows a multiple of 4 */
+ nOutCols = nInCols / 8;
+diff --git a/converter/pbm/pbmtoppa/pbm.c b/converter/pbm/pbmtoppa/pbm.c
+index 2f8a42b..1c8d236 100644
+--- a/converter/pbm/pbmtoppa/pbm.c
++++ b/converter/pbm/pbmtoppa/pbm.c
+@@ -106,6 +106,7 @@ int pbm_readline(pbm_stat* pbm,unsigned char* data)
+ return 0;
+
+ case P4:
++ overflow_add(pbm->width, 7);
+ tmp=(pbm->width+7)/8;
+ tmp2=fread(data,1,tmp,pbm->fptr);
+ if(tmp2 == tmp)
+@@ -130,6 +131,7 @@ void pbm_unreadline (pbm_stat *pbm, void *data)
+ return;
+
+ pbm->unread = 1;
++ overflow_add(pbm->width, 7);
+ pbm->revdata = malloc ((pbm->width+7)/8);
+ memcpy (pbm->revdata, data, (pbm->width+7)/8);
+ pbm->current_line--;
+diff --git a/converter/pbm/pbmtoppa/pbmtoppa.c b/converter/pbm/pbmtoppa/pbmtoppa.c
+index f43c08a..98e0284 100644
+--- a/converter/pbm/pbmtoppa/pbmtoppa.c
++++ b/converter/pbm/pbmtoppa/pbmtoppa.c
+@@ -452,6 +452,7 @@ main(int argc, char *argv[]) {
+ pm_error("main(): unrecognized parameter '%s'", argv[argn]);
+ }
+
++ overflow_add(Width, 7);
+ Pwidth=(Width+7)/8;
+ printer.fptr=out;
+
+diff --git a/converter/pbm/pbmtoxbm.c b/converter/pbm/pbmtoxbm.c
+index 14c6b85..362b70e 100644
+--- a/converter/pbm/pbmtoxbm.c
++++ b/converter/pbm/pbmtoxbm.c
+@@ -351,6 +351,8 @@ convertRaster(FILE * const ifP,
+
+ unsigned char * bitrow;
+ unsigned int row;
++
++ overflow_add(cols, padright);
+
+ putinit(xbmVersion);
+
+diff --git a/converter/pbm/pktopbm.c b/converter/pbm/pktopbm.c
+index 712f339..b6fcb02 100644
+--- a/converter/pbm/pktopbm.c
++++ b/converter/pbm/pktopbm.c
+@@ -280,6 +280,7 @@ main(int argc, char *argv[]) {
+ if (flagbyte == 7) { /* long form preamble */
+ integer packetlength = get32() ; /* character packet length */
+ car = get32() ; /* character number */
++ overflow_add(packetlength, pktopbm_pkloc);
+ endofpacket = packetlength + pktopbm_pkloc;
+ /* calculate end of packet */
+ if ((car >= MAXPKCHAR) || !filename[car]) {
+diff --git a/converter/pbm/thinkjettopbm.l b/converter/pbm/thinkjettopbm.l
+index 5de4f2b..7f31de5 100644
+--- a/converter/pbm/thinkjettopbm.l
++++ b/converter/pbm/thinkjettopbm.l
+@@ -114,7 +114,9 @@ DIG [0-9]
+ <RASTERMODE>\033\*b{DIG}+W {
+ int l;
+ if (rowCount >= rowCapacity) {
+- rowCapacity += 100;
++ overflow_add(rowCapacity, 100);
++ rowCapacity += 100;
++ overflow2(rowCapacity, sizeof *rows);
+ rows = realloc (rows, rowCapacity * sizeof *rows);
+ if (rows == NULL)
+ pm_error ("Out of memory.");
+@@ -226,6 +228,8 @@ 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 --git a/converter/pbm/ybmtopbm.c b/converter/pbm/ybmtopbm.c
+index 2a42908..cf1ff03 100644
+--- a/converter/pbm/ybmtopbm.c
++++ b/converter/pbm/ybmtopbm.c
+@@ -43,6 +43,7 @@ getinit(FILE * const ifP,
+ pm_error("EOF / read error");
+
+ *depthP = 1;
++ overflow_add(*colsP, 15);
+ }
+
+
+diff --git a/converter/pgm/lispmtopgm.c b/converter/pgm/lispmtopgm.c
+index 40dd3fb..b5469f7 100644
+--- a/converter/pgm/lispmtopgm.c
++++ b/converter/pgm/lispmtopgm.c
+@@ -58,6 +58,7 @@ main( argc, argv )
+ pm_error( "depth (%d bits) is too large", depth);
+
+ pgm_writepgminit( stdout, cols, rows, (gray) maxval, 0 );
++ overflow_add(cols, 7);
+ grayrow = pgm_allocrow( ( cols + 7 ) / 8 * 8 );
+
+ for ( row = 0; row < rows; ++row )
+@@ -102,6 +103,8 @@ getinit( file, colsP, rowsP, depthP, padrightP )
+
+ if ( *depthP == 0 )
+ *depthP = 1; /* very old file */
++
++ overflow_add((int)colsP, 31);
+
+ *padrightP = ( ( *colsP + 31 ) / 32 ) * 32 - *colsP;
+
+diff --git a/converter/pgm/psidtopgm.c b/converter/pgm/psidtopgm.c
+index 07417d1..25bb311 100644
+--- a/converter/pgm/psidtopgm.c
++++ b/converter/pgm/psidtopgm.c
+@@ -78,6 +78,7 @@ main(int argc,
+ pm_error("bits/sample (%d) is too large.", bitspersample);
+
+ pgm_writepgminit(stdout, cols, rows, maxval, 0);
++ overflow_add(cols, 7);
+ grayrow = pgm_allocrow((cols + 7) / 8 * 8);
+ for (row = 0; row < rows; ++row) {
+ unsigned int col;
+diff --git a/converter/ppm/Makefile b/converter/ppm/Makefile
+index 09f05cd..f68170f 100644
+--- a/converter/ppm/Makefile
++++ b/converter/ppm/Makefile
+@@ -11,7 +11,7 @@ SUBDIRS = hpcdtoppm
+
+ PORTBINARIES = 411toppm eyuvtoppm gouldtoppm ilbmtoppm imgtoppm \
+ leaftoppm mtvtoppm neotoppm \
+- pcxtoppm pc1toppm pi1toppm picttoppm pjtoppm \
++ pcxtoppm pc1toppm pi1toppm pjtoppm \
+ ppmtoacad ppmtoapplevol ppmtoarbtxt ppmtoascii \
+ ppmtobmp ppmtoeyuv ppmtogif ppmtoicr ppmtoilbm \
+ ppmtoleaf ppmtolj ppmtomitsu ppmtoneo \
+diff --git a/converter/ppm/ilbmtoppm.c b/converter/ppm/ilbmtoppm.c
+index 662be0b..2a86efc 100644
+--- a/converter/ppm/ilbmtoppm.c
++++ b/converter/ppm/ilbmtoppm.c
+@@ -606,6 +606,7 @@ decode_row(FILE * const ifP,
+ rawtype *chp;
+
+ cols = bmhdP->w;
++ overflow_add(cols, 15);
+ bytes = RowBytes(cols);
+ for( plane = 0; plane < nPlanes; plane++ ) {
+ int mask;
+@@ -693,6 +694,23 @@ decode_mask(FILE * const ifP,
+ Multipalette handling
+ ****************************************************************************/
+
++static void *
++xmalloc2(x, y)
++ int x;
++ int y;
++{
++ void *mem;
++
++ overflow2(x,y);
++ if( x * y == 0 )
++ return NULL;
++
++ mem = malloc2(x,y);
++ if( mem == NULL )
++ pm_error("out of memory allocating %d bytes", x * y);
++ return mem;
++}
++
+
+ static void
+ multi_adjust(cmap, row, palchange)
+@@ -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);
+ MALLOCARRAY_NOFAIL(redtable, redmaxval +1);
+ MALLOCARRAY_NOFAIL(greentable, greenmaxval +1);
+ MALLOCARRAY_NOFAIL(bluetable, bluemaxval +1);
+@@ -1784,7 +1805,9 @@ PCHG_ConvertSmall(PCHG, cmap, mask, datasize)
+ ChangeCount32 = *data++;
+ datasize -= 2;
+
++ overflow_add(ChangeCount16, ChangeCount32);
+ changes = ChangeCount16 + ChangeCount32;
++ overflow_add(changes, 1);
+ for( i = 0; i < changes; i++ ) {
+ if( totalchanges >= PCHG->TotalChanges ) goto fail;
+ if( datasize < 2 ) goto fail;
+@@ -2049,6 +2072,9 @@ read_pchg(FILE * const ifP,
+ cmap->mp_change[i] = NULL;
+ if( PCHG.StartLine < 0 ) {
+ int nch;
++ if(PCHG.MaxReg < PCHG.MinReg)
++ pm_error("assert: MinReg > MaxReg");
++ overflow_add(PCHG.MaxReg-PCHG.MinReg, 2);
+ nch = PCHG.MaxReg - PCHG.MinReg +1;
+ MALLOCARRAY_NOFAIL(cmap->mp_init, nch + 1);
+ for( i = 0; i < nch; i++ )
+@@ -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 --git a/converter/ppm/imgtoppm.c b/converter/ppm/imgtoppm.c
+index 7078b88..eb8509e 100644
+--- a/converter/ppm/imgtoppm.c
++++ b/converter/ppm/imgtoppm.c
+@@ -84,6 +84,7 @@ main(int argc, char ** argv) {
+ len = atoi((char*) buf );
+ if ( fread( buf, len, 1, ifp ) != 1 )
+ pm_error( "bad colormap buf" );
++ overflow2(cmaplen, 3);
+ if ( cmaplen * 3 != len )
+ {
+ pm_message(
+@@ -105,6 +106,7 @@ main(int argc, char ** argv) {
+ pm_error( "bad pixel data header" );
+ buf[8] = '\0';
+ len = atoi((char*) buf );
++ overflow2(cols, rows);
+ if ( len != cols * rows )
+ pm_message(
+ "pixel data length (%d) does not match image size (%d)",
+diff --git a/converter/ppm/pcxtoppm.c b/converter/ppm/pcxtoppm.c
+index e252ba2..270ae3b 100644
+--- a/converter/ppm/pcxtoppm.c
++++ b/converter/ppm/pcxtoppm.c
+@@ -409,6 +409,7 @@ pcx_planes_to_pixels(pixels, bitplanes, bytesperline, planes, bitsperpixel)
+ /*
+ * clear the pixel buffer
+ */
++ overflow2(bytesperline, 8);
+ npixels = (bytesperline * 8) / bitsperpixel;
+ p = pixels;
+ while (--npixels >= 0)
+@@ -470,6 +471,7 @@ pcx_16col_to_ppm(FILE * const ifP,
+ }
+
+ /* BytesPerLine should be >= BitsPerPixel * cols / 8 */
++ overflow2(BytesPerLine, 8);
+ rawcols = BytesPerLine * 8 / BitsPerPixel;
+ if (headerCols > rawcols) {
+ pm_message("warning - BytesPerLine = %d, "
+diff --git a/converter/ppm/picttoppm.c b/converter/ppm/picttoppm.c
+index 828d527..8cdb7b3 100644
+--- a/converter/ppm/picttoppm.c
++++ b/converter/ppm/picttoppm.c
+@@ -1,3 +1,4 @@
++#error "Unfixable. Don't ship me"
+ /*
+ * picttoppm.c -- convert a MacIntosh PICT file to PPM format.
+ *
+diff --git a/converter/ppm/pjtoppm.c b/converter/ppm/pjtoppm.c
+index 7b694fb..62ce77e 100644
+--- a/converter/ppm/pjtoppm.c
++++ b/converter/ppm/pjtoppm.c
+@@ -127,20 +127,22 @@ main(argc, argv)
+ case 'V': /* send plane */
+ case 'W': /* send last plane */
+ if (rows == -1 || r >= rows || image == NULL) {
+- if (rows == -1 || r >= rows)
++ if (rows == -1 || r >= rows) {
++ overflow_add(rows, 100);
+ rows += 100;
++ }
++
+ if (image == NULL) {
+- MALLOCARRAY(image, rows * planes);
+- MALLOCARRAY(imlen, rows * planes);
++ image = (unsigned char **)
++ malloc3(rows , planes , sizeof(unsigned char *));
++ imlen = (int *) malloc3(rows , planes, sizeof(int));
+ }
+ else {
+- image = (unsigned char **)
+- realloc(image,
+- rows * planes *
+- sizeof(unsigned char *));
+- imlen = (int *)
+- realloc(imlen, rows * planes * sizeof(int));
+- }
++ overflow2(rows,planes);
++ image = (unsigned char **)
++ realloc2(image, rows * planes,
++ sizeof(unsigned char *));
++ imlen = (int *) realloc2(imlen, rows * planes, sizeof(int)); }
+ }
+ if (image == NULL || imlen == NULL)
+ pm_error("out of memory");
+@@ -212,8 +214,10 @@ main(argc, argv)
+ for (i = 0, c = 0; c < imlen[p + r * planes]; c += 2)
+ for (cmd = image[p + r * planes][c],
+ val = image[p + r * planes][c+1];
+- cmd >= 0 && i < newcols; cmd--, i++)
++ cmd >= 0 && i < newcols; cmd--, i++) {
+ buf[i] = val;
++ overflow_add(i, 1);
++ }
+ cols = cols > i ? cols : i;
+ free(image[p + r * planes]);
+ /*
+@@ -224,6 +228,7 @@ main(argc, argv)
+ image[p + r * planes] = (unsigned char *) realloc(buf, i);
+ }
+ }
++ overflow2(cols, 8);
+ cols *= 8;
+ }
+
+diff --git a/converter/ppm/ppmtoeyuv.c b/converter/ppm/ppmtoeyuv.c
+index f5ce115..6f072be 100644
+--- a/converter/ppm/ppmtoeyuv.c
++++ b/converter/ppm/ppmtoeyuv.c
+@@ -114,6 +114,7 @@ create_multiplication_tables(const pixval maxval) {
+
+ int index;
+
++ overflow_add(maxval, 1);
+ MALLOCARRAY_NOFAIL(mult299 , maxval+1);
+ MALLOCARRAY_NOFAIL(mult587 , maxval+1);
+ MALLOCARRAY_NOFAIL(mult114 , maxval+1);
+diff --git a/converter/ppm/ppmtolj.c b/converter/ppm/ppmtolj.c
+index 7ed814e..b4e7db1 100644
+--- a/converter/ppm/ppmtolj.c
++++ b/converter/ppm/ppmtolj.c
+@@ -182,6 +182,7 @@ int main(int argc, char *argv[]) {
+ ppm_readppminit( ifp, &cols, &rows, &maxval, &format );
+ pixelrow = ppm_allocrow( cols );
+
++ overflow2(cols, 6);
+ obuf = (unsigned char *) pm_allocrow(cols * 3, sizeof(unsigned char));
+ cbuf = (unsigned char *) pm_allocrow(cols * 6, sizeof(unsigned char));
+ if (mode == C_TRANS_MODE_DELTA)
+diff --git a/converter/ppm/ppmtomitsu.c b/converter/ppm/ppmtomitsu.c
+index e59f09b..1d2be20 100644
+--- a/converter/ppm/ppmtomitsu.c
++++ b/converter/ppm/ppmtomitsu.c
+@@ -685,6 +685,8 @@ main(int argc, char * argv[]) {
+ medias = MSize_User;
+
+ if (dpi300) {
++ overflow2(medias.maxcols, 2);
++ overflow2(medias.maxrows, 2);
+ medias.maxcols *= 2;
+ medias.maxrows *= 2;
+ }
+diff --git a/converter/ppm/ppmtopcx.c b/converter/ppm/ppmtopcx.c
+index fa68edc..97dfb2b 100644
+--- a/converter/ppm/ppmtopcx.c
++++ b/converter/ppm/ppmtopcx.c
+@@ -425,6 +425,8 @@ ppmTo16ColorPcx(pixel ** const pixels,
+ else Planes = 1;
+ }
+ }
++ overflow2(BitsPerPixel, cols);
++ overflow_add(BitsPerPixel * cols, 7);
+ BytesPerLine = ((cols * BitsPerPixel) + 7) / 8;
+ MALLOCARRAY_NOFAIL(indexRow, cols);
+ MALLOCARRAY_NOFAIL(planesrow, BytesPerLine);
+diff --git a/converter/ppm/ppmtopict.c b/converter/ppm/ppmtopict.c
+index 034e705..4541387 100644
+--- a/converter/ppm/ppmtopict.c
++++ b/converter/ppm/ppmtopict.c
+@@ -450,6 +450,8 @@ main(int argc, const char ** argv) {
+ putShort(stdout, 0); /* mode */
+
+ /* Finally, write out the data. */
++ overflow_add(cols/MAX_COUNT, 1);
++ overflow_add(cols, cols/MAX_COUNT+1);
+ outBuf = malloc((unsigned)(cols+cols/MAX_COUNT+1));
+ for (row = 0, oc = 0; row < rows; ++row) {
+ unsigned int rowSize;
+diff --git a/converter/ppm/ppmtopj.c b/converter/ppm/ppmtopj.c
+index d116773..fc84cac 100644
+--- a/converter/ppm/ppmtopj.c
++++ b/converter/ppm/ppmtopj.c
+@@ -179,6 +179,7 @@ char *argv[];
+ pixels = ppm_readppm( ifp, &cols, &rows, &maxval );
+
+ pm_close( ifp );
++ overflow2(cols,2);
+ obuf = (unsigned char *) pm_allocrow(cols, sizeof(unsigned char));
+ cbuf = (unsigned char *) pm_allocrow(cols * 2, sizeof(unsigned char));
+
+diff --git a/converter/ppm/ppmtopjxl.c b/converter/ppm/ppmtopjxl.c
+index ddf4963..b2c7e8e 100644
+--- a/converter/ppm/ppmtopjxl.c
++++ b/converter/ppm/ppmtopjxl.c
+@@ -306,6 +306,9 @@ main(int argc, const char * argv[]) {
+ if (maxval > PCL_MAXVAL)
+ pm_error("color range too large; reduce with ppmcscale");
+
++ if (cols < 0 || rows < 0)
++ pm_error("negative size is not possible");
++
+ /* Figure out the colormap. */
+ pm_message("Computing colormap...");
+ chv = ppm_computecolorhist(pixels, cols, rows, MAXCOLORS, &colors);
+@@ -325,6 +328,8 @@ main(int argc, const char * argv[]) {
+ case 0: /* direct mode (no palette) */
+ bpp = bitsperpixel(maxval); /* bits per pixel */
+ bpg = bpp; bpb = bpp;
++ overflow2(bpp, 3);
++ overflow_add(bpp*3, 7);
+ bpp = (bpp*3+7)>>3; /* bytes per pixel now */
+ bpr = (bpp<<3)-bpg-bpb;
+ bpp *= cols; /* bytes per row now */
+@@ -334,9 +339,13 @@ main(int argc, const char * argv[]) {
+ case 3: case 7: pclindex++;
+ default:
+ bpp = 8/pclindex;
++ overflow_add(cols, bpp);
++ if(bpp == 0)
++ pm_error("assert: no bpp");
+ bpp = (cols+bpp-1)/bpp; /* bytes per row */
+ }
+ }
++ overflow2(bpp,2);
+ inrow = (char *)malloc((unsigned)bpp);
+ outrow = (char *)malloc((unsigned)bpp*2);
+ runcnt = (signed char *)malloc((unsigned)bpp);
+diff --git a/converter/ppm/ppmtowinicon.c b/converter/ppm/ppmtowinicon.c
+index c673798..af2b445 100644
+--- a/converter/ppm/ppmtowinicon.c
++++ b/converter/ppm/ppmtowinicon.c
+@@ -12,6 +12,7 @@
+
+ #include <math.h>
+ #include <string.h>
++#include <stdlib.h>
+
+ #include "pm_c_util.h"
+ #include "winico.h"
+@@ -214,6 +215,7 @@ createAndBitmap (gray ** const ba, int const cols, int const rows,
+ MALLOCARRAY_NOFAIL(rowData, rows);
+ icBitmap->xBytes = xBytes;
+ icBitmap->data = rowData;
++ overflow2(xBytes, rows);
+ icBitmap->size = xBytes * rows;
+ for (y=0;y<rows;y++) {
+ u1 * row;
+@@ -342,6 +344,7 @@ create4Bitmap (pixel ** const pa, int const cols, int const rows,
+ MALLOCARRAY_NOFAIL(rowData, rows);
+ icBitmap->xBytes = xBytes;
+ icBitmap->data = rowData;
++ overflow2(xBytes, rows);
+ icBitmap->size = xBytes * rows;
+
+ for (y=0;y<rows;y++) {
+@@ -402,6 +405,7 @@ create8Bitmap (pixel ** const pa, int const cols, int const rows,
+ MALLOCARRAY_NOFAIL(rowData, rows);
+ icBitmap->xBytes = xBytes;
+ icBitmap->data = rowData;
++ overflow2(xBytes, rows);
+ icBitmap->size = xBytes * rows;
+
+ for (y=0;y<rows;y++) {
+@@ -709,7 +713,11 @@ addEntryToIcon(MS_Ico const MSIconData,
+ entry->bitcount = bpp;
+ entry->ih = createInfoHeader(entry, xorBitmap, andBitmap);
+ entry->colors = palette->colors;
+- entry->size_in_bytes =
++ overflow2(4, entry->color_count);
++ overflow_add(xorBitmap->size, andBitmap->size);
++ overflow_add(xorBitmap->size + andBitmap->size, 40);
++ overflow_add(xorBitmap->size + andBitmap->size + 40, 4 * entry->color_count);
++ entry->size_in_bytes =
+ xorBitmap->size + andBitmap->size + 40 + (4 * entry->color_count);
+ if (verbose)
+ pm_message("entry->size_in_bytes = %d + %d + %d = %d",
+diff --git a/converter/ppm/ppmtoxpm.c b/converter/ppm/ppmtoxpm.c
+index 38d9997..904c98d 100644
+--- a/converter/ppm/ppmtoxpm.c
++++ b/converter/ppm/ppmtoxpm.c
+@@ -197,6 +197,7 @@ genNumstr(unsigned int const input, int const digits) {
+ unsigned int i;
+
+ /* Allocate memory for printed number. Abort if error. */
++ overflow_add(digits, 1);
+ if (!(str = (char *) malloc(digits + 1)))
+ pm_error("out of memory");
+
+@@ -314,6 +315,7 @@ genCmap(colorhist_vector const chv,
+ unsigned int charsPerPixel;
+ unsigned int xpmMaxval;
+
++ if (includeTransparent) overflow_add(ncolors, 1);
+ MALLOCARRAY(cmap, cmapSize);
+ if (cmapP == NULL)
+ pm_error("Out of memory allocating %u bytes for a color map.",
+diff --git a/converter/ppm/qrttoppm.c b/converter/ppm/qrttoppm.c
+index 935463e..653084c 100644
+--- a/converter/ppm/qrttoppm.c
++++ b/converter/ppm/qrttoppm.c
+@@ -46,7 +46,7 @@ main( argc, argv )
+
+ ppm_writeppminit( stdout, cols, rows, maxval, 0 );
+ pixelrow = ppm_allocrow( cols );
+- buf = (unsigned char *) malloc( 3 * cols );
++ buf = (unsigned char *) malloc2( 3 , cols );
+ if ( buf == (unsigned char *) 0 )
+ pm_error( "out of memory" );
+
+diff --git a/converter/ppm/sldtoppm.c b/converter/ppm/sldtoppm.c
+index 6ba4cb4..fc6a498 100644
+--- a/converter/ppm/sldtoppm.c
++++ b/converter/ppm/sldtoppm.c
+@@ -464,6 +464,8 @@ slider(slvecfn slvec,
+
+ /* Allocate image buffer and clear it to black. */
+
++ overflow_add(ixdots, 1);
++ overflow_add(iydots, 1);
+ pixels = ppm_allocarray(pixcols = ixdots + 1, pixrows = iydots + 1);
+ PPM_ASSIGN(rgbcolor, 0, 0, 0);
+ ppmd_filledrectangle(pixels, pixcols, pixrows, pixmaxval, 0, 0,
+diff --git a/converter/ppm/ximtoppm.c b/converter/ppm/ximtoppm.c
+index ce5e639..a39b689 100644
+--- a/converter/ppm/ximtoppm.c
++++ b/converter/ppm/ximtoppm.c
+@@ -160,6 +163,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));
+ header->colors = (Color *)calloc((unsigned int)header->ncolors,
+ sizeof(Color));
+ if (header->colors == NULL) {
+diff --git a/editor/pamcut.c b/editor/pamcut.c
+index 7c41af3..72df687 100644
+--- a/editor/pamcut.c
++++ b/editor/pamcut.c
+@@ -655,6 +655,8 @@ cutOneImage(FILE * const ifP,
+
+ outpam = inpam; /* Initial value -- most fields should be same */
+ outpam.file = ofP;
++ overflow_add(rightcol, 1);
++ overflow_add(bottomrow, 1);
+ outpam.width = rightcol - leftcol + 1;
+ outpam.height = bottomrow - toprow + 1;
+
+diff --git a/editor/pbmreduce.c b/editor/pbmreduce.c
+index f49c8d9..580e5e0 100644
+--- a/editor/pbmreduce.c
++++ b/editor/pbmreduce.c
+@@ -94,6 +94,7 @@ main( argc, argv )
+ if (halftone == QT_FS) {
+ unsigned int col;
+ /* Initialize Floyd-Steinberg. */
++ overflow_add(newcols, 2);
+ MALLOCARRAY(thiserr, newcols + 2);
+ MALLOCARRAY(nexterr, newcols + 2);
+ if (thiserr == NULL || nexterr == NULL)
+diff --git a/editor/pnmgamma.c b/editor/pnmgamma.c
+index b357b0d..ec612d3 100644
+--- a/editor/pnmgamma.c
++++ b/editor/pnmgamma.c
+@@ -596,6 +596,7 @@ createGammaTables(enum transferFunction const transferFunction,
+ xelval ** const btableP) {
+
+ /* Allocate space for the tables. */
++ overflow_add(maxval, 1);
+ MALLOCARRAY(*rtableP, maxval+1);
+ MALLOCARRAY(*gtableP, maxval+1);
+ MALLOCARRAY(*btableP, maxval+1);
+diff --git a/editor/pnmhisteq.c b/editor/pnmhisteq.c
+index 8af4201..0c8d6e5 100644
+--- a/editor/pnmhisteq.c
++++ b/editor/pnmhisteq.c
+@@ -107,6 +107,7 @@ computeLuminosityHistogram(xel * const * const xels,
+ unsigned int pixelCount;
+ unsigned int * lumahist;
+
++ overflow_add(maxval, 1);
+ MALLOCARRAY(lumahist, maxval + 1);
+ if (lumahist == NULL)
+ pm_error("Out of storage allocating array for %u histogram elements",
+diff --git a/editor/pnmindex.csh b/editor/pnmindex.csh
+index c6f1e84..c513a84 100755
+--- a/editor/pnmindex.csh
++++ b/editor/pnmindex.csh
+@@ -1,5 +1,7 @@
+ #!/bin/csh -f
+ #
++echo "Unsafe code, needs debugging, do not ship"
++exit 1
+ # pnmindex - build a visual index of a bunch of anymaps
+ #
+ # Copyright (C) 1991 by Jef Poskanzer.
+diff --git a/editor/pnmpad.c b/editor/pnmpad.c
+index 1904b68..0797cf1 100644
+--- a/editor/pnmpad.c
++++ b/editor/pnmpad.c
+@@ -527,6 +527,8 @@ main(int argc, const char ** argv) {
+
+ computePadSizes(cmdline, cols, rows, &lpad, &rpad, &tpad, &bpad);
+
++ overflow_add(cols, lpad);
++ overflow_add(cols + lpad, rpad);
+ newcols = cols + lpad + rpad;
+
+ if (PNM_FORMAT_TYPE(format) == PBM_TYPE)
+diff --git a/editor/pnmremap.c b/editor/pnmremap.c
+index b2448cb..b924120 100644
+--- a/editor/pnmremap.c
++++ b/editor/pnmremap.c
+@@ -428,6 +428,7 @@ initFserr(struct pam * const pamP,
+
+ unsigned int const fserrSize = pamP->width + 2;
+
++ overflow_add(pamP->width, 2);
+ fserrP->width = pamP->width;
+
+ MALLOCARRAY(fserrP->thiserr, pamP->depth);
+@@ -465,6 +466,7 @@ floydInitRow(struct pam * const pamP, struct fserr * const fserrP) {
+
+ int col;
+
++ overflow_add(pamP->width, 2);
+ for (col = 0; col < pamP->width + 2; ++col) {
+ unsigned int plane;
+ for (plane = 0; plane < pamP->depth; ++plane)
+diff --git a/editor/pnmscalefixed.c b/editor/pnmscalefixed.c
+index 884ca31..747cd8f 100644
+--- a/editor/pnmscalefixed.c
++++ b/editor/pnmscalefixed.c
+@@ -214,6 +214,7 @@ compute_output_dimensions(const struct cmdline_info cmdline,
+ const int rows, const int cols,
+ int * newrowsP, int * newcolsP) {
+
++ overflow2(rows, cols);
+ if (cmdline.pixels) {
+ if (rows * cols <= cmdline.pixels) {
+ *newrowsP = rows;
+@@ -265,6 +266,8 @@ compute_output_dimensions(const struct cmdline_info cmdline,
+
+ if (*newcolsP < 1) *newcolsP = 1;
+ if (*newrowsP < 1) *newrowsP = 1;
++
++ overflow2(*newcolsP, *newrowsP);
+ }
+
+
+@@ -446,6 +449,9 @@ main(int argc, char **argv ) {
+ unfilled. We can address that by stretching, whereas the other
+ case would require throwing away some of the input.
+ */
++
++ overflow2(newcols, SCALE);
++ overflow2(newrows, SCALE);
+ sxscale = SCALE * newcols / cols;
+ syscale = SCALE * newrows / rows;
+
+diff --git a/editor/ppmdither.c b/editor/ppmdither.c
+index ec1b977..e701e09 100644
+--- a/editor/ppmdither.c
++++ b/editor/ppmdither.c
+@@ -356,6 +356,11 @@ dithMatrix(unsigned int const dithPower) {
+ (dithDim * sizeof(*dithMat)) + /* pointers */
+ (dithDim * dithDim * sizeof(**dithMat)); /* data */
+
++
++ overflow2(dithDim, sizeof(*dithMat));
++ overflow3(dithDim, dithDim, sizeof(**dithMat));
++ overflow_add(dithDim * sizeof(*dithMat), dithDim * dithDim * sizeof(**dithMat));
++
+ dithMat = malloc(dithMatSize);
+
+ if (dithMat == NULL)
+diff --git a/editor/specialty/pamoil.c b/editor/specialty/pamoil.c
+index 6cb8d3a..6f4bde9 100644
+--- a/editor/specialty/pamoil.c
++++ b/editor/specialty/pamoil.c
+@@ -112,6 +112,7 @@ main(int argc, char *argv[] ) {
+ tuples = pnm_readpam(ifp, &inpam, PAM_STRUCT_SIZE(tuple_type));
+ pm_close(ifp);
+
++ overflow_add(inpam.maxval, 1);
+ MALLOCARRAY(hist, inpam.maxval + 1);
+ if (hist == NULL)
+ pm_error("Unable to allocate memory for histogram.");
+diff --git a/generator/pbmtext.c b/generator/pbmtext.c
+index 9f4366d..445d718 100644
+--- a/generator/pbmtext.c
++++ b/generator/pbmtext.c
+@@ -96,12 +96,14 @@ parseCommandLine(int argc, const char ** argv,
+
+ for (i = 1; i < argc; ++i) {
+ if (i > 1) {
++ 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[],
+ pm_error("A line of input text is longer than %u characters."
+ "Cannot process.", (unsigned)sizeof(buf)-1);
+ if (lineCount >= maxlines) {
++ 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;
+ } else {
+ vmargin = fontP->maxheight;
++ overflow2(2, fontP->maxwidth);
+ hmargin = 2 * fontP->maxwidth;
+ }
+ }
+diff --git a/lib/libpam.c b/lib/libpam.c
+index cc6368e..4e10572 100644
+--- a/lib/libpam.c
++++ b/lib/libpam.c
+@@ -224,8 +224,9 @@ allocPamRow(const struct pam * const pamP) {
+ unsigned int const bytesPerTuple = allocationDepth(pamP) * sizeof(sample);
+ tuple * tuplerow;
+
+- tuplerow = malloc(pamP->width * (sizeof(tuple *) + bytesPerTuple));
+-
++ overflow_add(sizeof(tuple *), bytesPerTuple);
++ tuplerow = malloc2(pamP->width, (sizeof(tuple *) + bytesPerTuple));
++
+ if (tuplerow != NULL) {
+ /* Now we initialize the pointers to the individual tuples
+ to make this a regulation C two dimensional array.
+diff --git a/lib/libpammap.c b/lib/libpammap.c
+index 55e1d3f..04b1ba3 100644
+--- a/lib/libpammap.c
++++ b/lib/libpammap.c
+@@ -108,7 +108,9 @@ allocTupleIntListItem(struct pam * const pamP) {
+ */
+ struct tupleint_list_item * retval;
+
+- unsigned int const size =
++ overflow2(pamP->depth, sizeof(sample));
++ overflow_add(sizeof(*retval)-sizeof(retval->tupleint.tuple), pamP->depth*sizeof(sample));
++ unsigned int const size =
+ sizeof(*retval) - sizeof(retval->tupleint.tuple)
+ + pamP->depth * sizeof(sample);
+
+diff --git a/lib/libpm.c b/lib/libpm.c
+index 4374bbe..5ab7f83 100644
+--- a/lib/libpm.c
++++ b/lib/libpm.c
+@@ -841,5 +841,53 @@ pm_parse_height(const char * const arg) {
+ return height;
+ }
+
++/*
++ * Maths wrapping
++ */
+
++void __overflow2(int a, int b)
++{
++ if(a < 0 || b < 0)
++ pm_error("object too large");
++ if(b == 0)
++ return;
++ if(a > INT_MAX / b)
++ pm_error("object too large");
++}
++
++void overflow3(int a, int b, int c)
++{
++ overflow2(a,b);
++ overflow2(a*b, c);
++}
++
++void overflow_add(int a, int b)
++{
++ if( a > INT_MAX - b)
++ pm_error("object too large");
++}
++
++void *malloc2(int a, int b)
++{
++ overflow2(a, b);
++ if(a*b == 0)
++ pm_error("Zero byte allocation");
++ return malloc(a*b);
++}
++
++void *malloc3(int a, int b, int c)
++{
++ overflow3(a, b, c);
++ if(a*b*c == 0)
++ pm_error("Zero byte allocation");
++ return malloc(a*b*c);
++}
++
++void *realloc2(void * a, int b, int c)
++{
++ overflow2(b, c);
++ if(b*c == 0)
++ pm_error("Zero byte allocation");
++ return realloc(a, b*c);
++}
+
+diff --git a/lib/pm.h b/lib/pm.h
+index e9f1405..da54391 100644
+--- a/lib/pm.h
++++ b/lib/pm.h
+@@ -435,5 +435,12 @@ pm_parse_height(const char * const arg);
+ }
+ #endif
+
++void *malloc2(int, int);
++void *malloc3(int, int, int);
++#define overflow2(a,b) __overflow2(a,b)
++void __overflow2(int, int);
++void overflow3(int, int, int);
++void overflow_add(int, int);
++
+
+ #endif
+diff --git a/other/pnmcolormap.c b/other/pnmcolormap.c
+index 57db432..7195295 100644
+--- a/other/pnmcolormap.c
++++ b/other/pnmcolormap.c
+@@ -840,6 +840,7 @@ colormapToSquare(struct pam * const pamP,
+ pamP->width = intsqrt;
+ else
+ pamP->width = intsqrt + 1;
++ overflow_add(intsqrt, 1);
+ }
+ {
+ unsigned int const intQuotient = colormap.size / pamP->width;
+diff --git a/urt/Runput.c b/urt/Runput.c
+index 3bc562a..645a376 100644
+--- a/urt/Runput.c
++++ b/urt/Runput.c
+@@ -202,10 +202,11 @@ RunSetup(rle_hdr * the_hdr)
+ if ( the_hdr->background != 0 )
+ {
+ register int i;
+- register rle_pixel *background =
+- (rle_pixel *)malloc( (unsigned)(the_hdr->ncolors + 1) );
+- register int *bg_color;
+- /*
++ register rle_pixel *background;
++ register int *bg_color;
++
++ overflow_add(the_hdr->ncolors,1);
++ background = (rle_pixel *)malloc( (unsigned)(the_hdr->ncolors + 1) ); /*
+ * If even number of bg color bytes, put out one more to get to
+ * 16 bit boundary.
+ */
+@@ -224,7 +225,7 @@ RunSetup(rle_hdr * the_hdr)
+ /* Big-endian machines are harder */
+ register int i, nmap = (1 << the_hdr->cmaplen) *
+ the_hdr->ncmap;
+- register char *h_cmap = (char *)malloc( nmap * 2 );
++ register char *h_cmap = (char *)malloc2( nmap, 2 );
+ if ( h_cmap == NULL )
+ {
+ fprintf( stderr,
+diff --git a/urt/rle.h b/urt/rle.h
+index 8d72cb9..ac65b94 100644
+--- a/urt/rle.h
++++ b/urt/rle.h
+@@ -161,6 +161,17 @@ rle_hdr /* End of typedef. */
+ */
+ extern rle_hdr rle_dflt_hdr;
+
++/*
++ * Provided by pm library
++ */
++
++extern void overflow_add(int, int);
++#define overflow2(a,b) __overflow2(a,b)
++extern void __overflow2(int, int);
++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 --git a/urt/rle_addhist.c b/urt/rle_addhist.c
+index b165175..e09ed94 100644
+--- a/urt/rle_addhist.c
++++ b/urt/rle_addhist.c
+@@ -70,13 +70,18 @@ rle_addhist(char * argv[],
+ return;
+
+ length = 0;
+- for (i = 0; argv[i]; ++i)
++ for (i = 0; argv[i]; ++i) {
++ overflow_add(length, strlen(argv[i]));
++ overflow_add(length+1, strlen(argv[i]));
+ length += strlen(argv[i]) +1; /* length of each arg plus space. */
++ }
+
+ time(&temp);
+ timedate = ctime(&temp);
+ length += strlen(timedate); /* length of date and time in ASCII. */
+-
++ overflow_add(strlen(padding), 4);
++ overflow_add(strlen(histoire), strlen(padding) + 4);
++ overflow_add(length, strlen(histoire) + strlen(padding) + 4);
+ length += strlen(padding) + 3 + strlen(histoire) + 1;
+ /* length of padding, "on " and length of history name plus "="*/
+ if (in_hdr) /* if we are interested in the old comments... */
+@@ -84,8 +89,10 @@ rle_addhist(char * argv[],
+ else
+ old = NULL;
+
+- if (old && *old)
++ if (old && *old) {
++ overflow_add(length, strlen(old));
+ length += strlen(old); /* add length if there. */
++ }
+
+ ++length; /*Cater for the null. */
+
+diff --git a/urt/rle_getrow.c b/urt/rle_getrow.c
+index bd7d1c8..bd05698 100644
+--- a/urt/rle_getrow.c
++++ b/urt/rle_getrow.c
+@@ -168,6 +168,7 @@ rle_get_setup(rle_hdr * const the_hdr) {
+ char * cp;
+
+ VAXSHORT(comlen, infile); /* get comment length */
++ overflow_add(comlen, 1);
+ evenlen = (comlen + 1) & ~1; /* make it even */
+ if (evenlen) {
+ MALLOCARRAY(comment_buf, evenlen);
+diff --git a/urt/rle_hdr.c b/urt/rle_hdr.c
+index 1611324..7c9c010 100644
+--- a/urt/rle_hdr.c
++++ b/urt/rle_hdr.c
+@@ -80,7 +80,10 @@ int img_num;
+ /* Fill in with copies of the strings. */
+ if ( the_hdr->cmd != pgmname )
+ {
+- char *tmp = (char *)malloc( strlen( pgmname ) + 1 );
++ char *tmp;
++
++ overflow_add(strlen(pgmname), 1);
++ tmp = malloc( strlen(pgmname) + 1 );
+ RLE_CHECK_ALLOC( pgmname, tmp, 0 );
+ strcpy( tmp, pgmname );
+ the_hdr->cmd = tmp;
+@@ -88,8 +91,10 @@ int img_num;
+
+ if ( the_hdr->file_name != fname )
+ {
+- char *tmp = (char *)malloc( strlen( fname ) + 1 );
+- RLE_CHECK_ALLOC( pgmname, tmp, 0 );
++ char *tmp;
++ overflow_add(strlen(fname), 1);
++ tmp = malloc( strlen( fname ) + 1 );
++ RLE_CHECK_ALLOC( pgmname, tmp, 0 );
+ strcpy( tmp, fname );
+ the_hdr->file_name = tmp;
+ }
+@@ -153,6 +158,7 @@ rle_hdr *from_hdr, *to_hdr;
+ if ( to_hdr->bg_color )
+ {
+ int size = to_hdr->ncolors * sizeof(int);
++ overflow2(to_hdr->ncolors, sizeof(int));
+ to_hdr->bg_color = (int *)malloc( size );
+ RLE_CHECK_ALLOC( to_hdr->cmd, to_hdr->bg_color, "background color" );
+ memcpy( to_hdr->bg_color, from_hdr->bg_color, size );
+@@ -161,7 +167,7 @@ rle_hdr *from_hdr, *to_hdr;
+ if ( to_hdr->cmap )
+ {
+ int size = to_hdr->ncmap * (1 << to_hdr->cmaplen) * sizeof(rle_map);
+- to_hdr->cmap = (rle_map *)malloc( size );
++ to_hdr->cmap = (rle_map *)malloc3( to_hdr->ncmap, 1<<to_hdr->cmaplen, sizeof(rle_map));
+ RLE_CHECK_ALLOC( to_hdr->cmd, to_hdr->cmap, "color map" );
+ memcpy( to_hdr->cmap, from_hdr->cmap, size );
+ }
+@@ -173,12 +179,17 @@ rle_hdr *from_hdr, *to_hdr;
+ {
+ int size = 0;
+ CONST_DECL char **cp;
+- for ( cp=to_hdr->comments; *cp; cp++ )
++ for ( cp=to_hdr->comments; *cp; cp++ )
++ {
++ overflow_add(size, 1);
+ size++; /* Count the comments. */
++ }
+ /* Check if there are really any comments. */
+ if ( size )
+ {
++ overflow_add(size, 1);
+ size++; /* Copy the NULL pointer, too. */
++ overflow2(size, sizeof(char *));
+ size *= sizeof(char *);
+ to_hdr->comments = (CONST_DECL char **)malloc( size );
+ RLE_CHECK_ALLOC( to_hdr->cmd, to_hdr->comments, "comments" );
+diff --git a/urt/rle_open_f.c b/urt/rle_open_f.c
+index ae8548b..c2ef37d 100644
+--- a/urt/rle_open_f.c
++++ b/urt/rle_open_f.c
+@@ -163,65 +163,7 @@ dealWithSubprocess(const char * const file_name,
+ FILE ** const fpP,
+ bool * const noSubprocessP,
+ const char ** const errorP) {
+-
+-#ifdef NO_OPEN_PIPES
+ *noSubprocessP = TRUE;
+-#else
+- const char *cp;
+-
+- reapChildren(catchingChildrenP, pids);
+-
+- /* Real file, not stdin or stdout. If name ends in ".Z",
+- * pipe from/to un/compress (depending on r/w mode).
+- *
+- * If it starts with "|", popen that command.
+- */
+-
+- cp = file_name + strlen(file_name) - 2;
+- /* Pipe case. */
+- if (file_name[0] == '|') {
+- pid_t thepid; /* PID from my_popen */
+-
+- *noSubprocessP = FALSE;
+-
+- *fpP = my_popen(file_name + 1, mode, &thepid);
+- if (*fpP == NULL)
+- *errorP = "%s: can't invoke <<%s>> for %s: ";
+- else {
+- /* One more child to catch, eventually. */
+- if (*catchingChildrenP < MAX_CHILDREN)
+- pids[(*catchingChildrenP)++] = thepid;
+- }
+- } else if (cp > file_name && *cp == '.' && *(cp + 1) == 'Z' ) {
+- /* Compress case. */
+- pid_t thepid; /* PID from my_popen. */
+- const char * command;
+-
+- *noSubprocessP = FALSE;
+-
+- if (*mode == 'w')
+- pm_asprintf(&command, "compress > %s", file_name);
+- else if (*mode == 'a')
+- pm_asprintf(&command, "compress >> %s", file_name);
+- else
+- pm_asprintf(&command, "compress -d < %s", file_name);
+-
+- *fpP = my_popen(command, mode, &thepid);
+-
+- if (*fpP == NULL)
+- *errorP = "%s: can't invoke 'compress' program, "
+- "trying to open %s for %s";
+- else {
+- /* One more child to catch, eventually. */
+- if (*catchingChildrenP < MAX_CHILDREN)
+- pids[(*catchingChildrenP)++] = thepid;
+- }
+- pm_strfree(command);
+- } else {
+- *noSubprocessP = TRUE;
+- *errorP = NULL;
+- }
+-#endif
+ }
+
+
+diff --git a/urt/rle_putcom.c b/urt/rle_putcom.c
+index ab2eb20..f6a6ff7 100644
+--- a/urt/rle_putcom.c
++++ b/urt/rle_putcom.c
+@@ -98,12 +98,14 @@ rle_putcom(const char * const value,
+ const char * v;
+ const char ** old_comments;
+ int i;
+- for (i = 2, cp = the_hdr->comments; *cp != NULL; ++i, ++cp)
++ for (i = 2, cp = the_hdr->comments; *cp != NULL; ++i, ++cp) {
++ overflow_add(i, 1);
+ 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 --git a/urt/scanargs.c b/urt/scanargs.c
+index f3af334..5e114bb 100644
+--- a/urt/scanargs.c
++++ b/urt/scanargs.c
+@@ -62,9 +62,8 @@ typedef int *ptr;
+ /*
+ * Storage allocation macros
+ */
+-#define NEW( type, cnt ) (type *) malloc( (cnt) * sizeof( type ) )
+-#define RENEW( type, ptr, cnt ) (type *) realloc( ptr, (cnt) * sizeof( type ) )
+-
++#define NEW( type, cnt ) (type *) malloc2( (cnt) , sizeof( type ) )
++#define RENEW( type, ptr, cnt ) (type *) realloc2( ptr, (cnt), sizeof( type ) )
+ static CONST_DECL char * prformat( CONST_DECL char *, int );
+ static int isnum( CONST_DECL char *, int, int );
+ static int _do_scanargs( int argc, char **argv, CONST_DECL char *format,
+
diff --git a/manualPorts/netpbm/netpbm-security-scripts.patch b/manualPorts/netpbm/netpbm-security-scripts.patch
new file mode 100644
index 0000000..0dfe84f
--- /dev/null
+++ b/manualPorts/netpbm/netpbm-security-scripts.patch
@@ -0,0 +1,369 @@
+diff --git a/converter/other/anytopnm b/converter/other/anytopnm
+index acf8813..335312a 100755
+--- a/converter/other/anytopnm
++++ b/converter/other/anytopnm
+@@ -511,10 +511,7 @@ else
+ inputFile="-"
+ fi
+
+-tempdir="${TMPDIR-/tmp}/anytopnm.$$"
+-mkdir -m 0700 $tempdir || \
+- { echo "Could not create temporary file. Exiting."; 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
+@@ -537,12 +534,17 @@ typeDescription=`file "$file" | cut -d: -f2- | cut -c2-`
+ determineType "$file" "$mimeType" "$typeDescription" "$fileExtension"
+
+ if [ "$filetype" = "unknown" ]; then
+- echo "$progname: unknown file type. " \
+- "'file' says mime type is '$mimeType', " 1>&2
+- echo "type description is '$typeDescription'" 1>&2
++ if [ -d "$tempdir" ] ; then
++ rm -rf "$tempdir"
++ fi
++
+ exit 1
+ fi
+
+ convertIt $file $filetype
+
++if [ -d "$tempdir" ] ; then
++ rm -rf "$tempdir"
++fi
++
+ exit 0
+diff --git a/editor/pamstretch-gen b/editor/pamstretch-gen
+index ba0e818..250fca0 100755
+--- a/editor/pamstretch-gen
++++ b/editor/pamstretch-gen
+@@ -31,9 +31,7 @@ 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
+ trap 'rm -rf $tempdir' 0 1 3 15
+
+ tempfile=$tempdir/pnmig
+diff --git a/editor/pnmmargin b/editor/pnmmargin
+index 0f57d1d..e0d3625 100755
+--- a/editor/pnmmargin
++++ b/editor/pnmmargin
+@@ -11,11 +11,7 @@
+ # 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
+-
++tempdir=$(mktemp -d -t ppmmargin.XXXXXXX) || exit 1
+ tmp1=$tempdir/pnmm1
+ tmp2=$tempdir/pnmm2
+ tmp3=$tempdir/pnmm3
+@@ -90,6 +86,7 @@ else
+ -white | -black )
+ pnmpad $plainopt $color \
+ -left=$size -right=$size -top=$size -bottom=$size $tmp1
++ rm -rf "$tempdir"
+ exit
+ ;;
+ * )
+@@ -103,4 +100,4 @@ else
+ pnmcat -tb $plainopt $tmp3 $tmp4 $tmp3
+ fi
+
+-
++rm -rf "$tempdir"
+diff --git a/editor/ppmfade b/editor/ppmfade
+index 027fc79..8eb094f 100755
+--- a/editor/ppmfade
++++ b/editor/ppmfade
+@@ -40,6 +40,7 @@ exec perl -w -x -S -- "$0" "$@"
+ #
+ ##############################################################################
+ use strict;
++use File::Temp "tempdir";
+
+ my $SPREAD = 1;
+ my $SHIFT = 2;
+@@ -137,20 +138,26 @@ if ($first_file ne "undefined") {
+
+ print("Frames are " . $width . "W x " . $height . "H\n");
+
++#
++# We create a tmp-directory right here
++#
++my $tmpdir = tempdir("ppmfade.XXXXXX", CLEANUP => 1);
++
++
+ if ($first_file eq "undefined") {
+ print "Fading from black to ";
+- system("ppmmake \\#000 $width $height >junk1$$.ppm");
++ system("ppmmake \\#000 $width $height >$tmpdir/junk1$$.ppm");
+ } else {
+ print "Fading from $first_file to ";
+- system("cp", $first_file, "junk1$$.ppm");
++ system("cp", $first_file, "$tmpdir/junk1$$.ppm");
+ }
+
+ if ($last_file eq "undefined") {
+ print "black.\n";
+- system("ppmmake \\#000 $width $height >junk2$$.ppm");
++ system("ppmmake \\#000 $width $height >$tmpdir/junk2$$.ppm");
+ } else {
+ print "$last_file\n";
+- system("cp", $last_file, "junk2$$.ppm");
++ system("cp", $last_file, "$tmpdir/junk2$$.ppm");
+ }
+
+ #
+@@ -158,14 +165,14 @@ if ($last_file eq "undefined") {
+ #
+
+ # Here's what our temporary files are:
+-# junk1$$.ppm: The original (fade-from) image
+-# junk2$$.ppm: The target (fade-from) image
+-# junk3$$.ppm: The frame of the fade for the current iteration of the
+-# the for loop.
+-# junk1a$$.ppm: If the fade involves a ppmmix sequence from one intermediate
+-# image to another, this is the first frame of that
+-# sequence.
+-# junk2a$$.ppm: This is the last frame of the above-mentioned ppmmix sequence
++# $tmpdir/junk1$$.ppm: The original (fade-from) image
++# $tmpdir/junk2$$.ppm: The target (fade-from) image
++# $tmpdir/junk3$$.ppm: The frame of the fade for the current iteration of the
++# the for loop.
++# $tmpdir/junk1a$$.ppm: If the fade involves a ppmmix sequence from one intermediate
++# image to another, this is the first frame of that
++# sequence.
++# $tmpdir/junk2a$$.ppm: This is the last frame of the above-mentioned ppmmix sequence
+
+ my $i; # Frame number
+ for ($i = 1; $i <= $nframes; $i++) {
+@@ -173,147 +180,147 @@ for ($i = 1; $i <= $nframes; $i++) {
+ if ($mode eq $SPREAD) {
+ if ($i <= 10) {
+ my $n = $spline20[$i] * 100;
+- system("ppmspread $n junk1$$.ppm >junk3$$.ppm");
++ system("ppmspread $n $tmpdir/junk1$$.ppm >$tmpdir/junk3$$.ppm");
+ } elsif ($i <= 20) {
+ my $n;
+ $n = $spline20[$i] * 100;
+- system("ppmspread $n junk1$$.ppm >junk1a$$.ppm");
++ system("ppmspread $n $tmpdir/junk1$$.ppm >$tmpdir/junk1a$$.ppm");
+ $n = (1-$spline20[$i-10]) * 100;
+- system("ppmspread $n junk2$$.ppm >junk2a$$.ppm");
++ system("ppmspread $n $tmpdir/junk2$$.ppm >$tmpdir/junk2a$$.ppm");
+ $n = $spline10[$i-10];
+- system("ppmmix $n junk1a$$.ppm junk2a$$.ppm >junk3$$.ppm");
++ system("ppmmix $n $tmpdir/junk1a$$.ppm $tmpdir/junk2a$$.ppm >$tmpdir/junk3$$.ppm");
+ } else {
+ my $n = (1-$spline20[$i-10])*100;
+- system("ppmspread $n junk2$$.ppm >junk3$$.ppm");
++ system("ppmspread $n $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
+ }
+ } elsif ($mode eq $SHIFT) {
+ if ($i <= 10) {
+ my $n = $spline20[$i] * 100;
+- system("ppmshift $n junk1$$.ppm >junk3$$.ppm");
++ system("ppmshift $n $tmpdir/junk1$$.ppm >$tmpdir/junk3$$.ppm");
+ } elsif ($i <= 20) {
+ my $n;
+ $n = $spline20[$i] * 100;
+- system("ppmshift $n junk1$$.ppm >junk1a$$.ppm");
++ system("ppmshift $n $tmpdir/junk1$$.ppm >$tmpdir/junk1a$$.ppm");
+ $n = (1-$spline20[$i-10])*100;
+- system("ppmshift $n junk2$$.ppm >junk2a$$.ppm");
++ system("ppmshift $n $tmpdir/junk2$$.ppm >$tmpdir/junk2a$$.ppm");
+ $n = $spline10[$i-10];
+- system("ppmmix $n junk1a$$.ppm junk2a$$.ppm >junk3$$.ppm");
++ system("ppmmix $n $tmpdir/junk1a$$.ppm $tmpdir/junk2a$$.ppm >$tmpdir/junk3$$.ppm");
+ } else {
+ my $n = (1-$spline20[$i-10]) * 100;
+- system("ppmshift $n junk2$$.ppm >junk3$$.ppm");
++ system("ppmshift $n $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
+ }
+ } elsif ($mode eq $RELIEF) {
+ if ($i == 1) {
+- system("ppmrelief junk1$$.ppm >junk1r$$.ppm");
++ system("ppmrelief $tmpdir/junk1$$.ppm >$tmpdir/junk1r$$.ppm");
+ }
+ if ($i <= 10) {
+ my $n = $spline10[$i];
+- system("ppmmix $n junk1$$.ppm junk1r$$.ppm >junk3$$.ppm");
++ system("ppmmix $n $tmpdir/junk1$$.ppm $tmpdir/junk1r$$.ppm >$tmpdir/junk3$$.ppm");
+ } elsif ($i <= 20) {
+ my $n = $spline10[$i-10];
+- system("ppmmix $n junk1r$$.ppm junk2r$$.ppm >junk3$$.ppm");
++ system("ppmmix $n $tmpdir/junk1r$$.ppm $tmpdir/junk2r$$.ppm >$tmpdir/junk3$$.ppm");
+ } else {
+ my $n = $spline10[$i-20];
+- system("ppmmix $n junk2r$$.ppm junk2$$.ppm >junk3$$.ppm");
++ system("ppmmix $n $tmpdir/junk2r$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
+ }
+ if ($i == 10) {
+- system("ppmrelief junk2$$.ppm >junk2r$$.ppm");
++ system("ppmrelief $tmpdir/junk2$$.ppm >$tmpdir/junk2r$$.ppm");
+ }
+ } elsif ($mode eq $OIL) {
+ if ($i == 1) {
+- system("ppmtopgm junk1$$.ppm | pgmoil >junko$$.ppm");
+- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " .
+- ">junk1o$$.ppm");
++ system("ppmtopgm $tmpdir/junk1$$.ppm | pgmoil >$tmpdir/junko$$.ppm");
++ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " .
++ ">$tmpdir/junk1o$$.ppm");
+ }
+ if ($i <= 10) {
+ my $n = $spline10[$i];
+- system("ppmmix $n junk1$$.ppm junk1o$$.ppm >junk3$$.ppm");
++ system("ppmmix $n $tmpdir/junk1$$.ppm $tmpdir/junk1o$$.ppm >$tmpdir/junk3$$.ppm");
+ } elsif ($i <= 20) {
+ my $n = $spline10[$i-10];
+- system("ppmmix $n junk1o$$.ppm junk2o$$.ppm >junk3$$.ppm");
++ system("ppmmix $n $tmpdir/junk1o$$.ppm $tmpdir/junk2o$$.ppm >$tmpdir/junk3$$.ppm");
+ } else {
+ my $n = $spline10[$i-20];
+- system("ppmmix $n junk2o$$.ppm junk2$$.ppm >junk3$$.ppm");
++ system("ppmmix $n $tmpdir/junk2o$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
+ }
+ if ($i == 10) {
+- system("ppmtopgm junk2$$.ppm | pgmoil >junko$$.ppm");
+- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " .
+- ">junk2o$$.ppm");
++ system("ppmtopgm $tmpdir/junk2$$.ppm | pgmoil >$tmpdir/junko$$.ppm");
++ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " .
++ ">$tmpdir/junk2o$$.ppm");
+ }
+ } elsif ($mode eq $EDGE) {
+ if ($i == 1) {
+- system("ppmtopgm junk1$$.ppm | pgmedge >junko$$.ppm");
+- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " .
+- ">junk1o$$.ppm");
++ system("ppmtopgm $tmpdir/junk1$$.ppm | pgmedge >$tmpdir/junko$$.ppm");
++ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " .
++ ">$tmpdir/junk1o$$.ppm");
+ }
+ if ($i <= 10) {
+ my $n = $spline10[$i];
+- system("ppmmix $n junk1$$.ppm junk1o$$.ppm >junk3$$.ppm");
++ system("ppmmix $n $tmpdir/junk1$$.ppm $tmpdir/junk1o$$.ppm >$tmpdir/junk3$$.ppm");
+ } elsif ($i <= 20) {
+ my $n = $spline10[$i-10];
+- system("ppmmix $n junk1o$$.ppm junk2o$$.ppm >junk3$$.ppm");
++ system("ppmmix $n $tmpdir/junk1o$$.ppm $tmpdir/junk2o$$.ppm >$tmpdir/junk3$$.ppm");
+ } else {
+ my $n = $spline10[$i-20];
+- system("ppmmix $n junk2o$$.ppm junk2$$.ppm >junk3$$.ppm");
++ system("ppmmix $n $tmpdir/junk2o$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
+ }
+ if ($i == 10) {
+- system("ppmtopgm junk2$$.ppm | pgmedge >junko$$.ppm");
+- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " .
+- ">junk2o$$.ppm");
++ system("ppmtopgm $tmpdir/junk2$$.ppm | pgmedge >$tmpdir/junko$$.ppm");
++ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " .
++ ">$tmpdir/junk2o$$.ppm");
+ }
+ } elsif ($mode eq $BENTLEY) {
+ if ($i == 1) {
+- system("ppmtopgm junk1$$.ppm | pgmbentley >junko$$.ppm");
+- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " .
+- ">junk1o$$.ppm");
++ system("ppmtopgm $tmpdir/junk1$$.ppm | pgmbentley >$tmpdir/junko$$.ppm");
++ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " .
++ ">$tmpdir/junk1o$$.ppm");
+ }
+ if ($i <= 10) {
+ my $n = $spline10[$i];
+- system("ppmmix $n junk1$$.ppm junk1o$$.ppm >junk3$$.ppm");
++ system("ppmmix $n $tmpdir/junk1$$.ppm $tmpdir/junk1o$$.ppm >$tmpdir/junk3$$.ppm");
+ } elsif ($i <= 20) {
+ my $n = $spline10[$i-10];
+- system("ppmmix $n junk1o$$.ppm junk2o$$.ppm >junk3$$.ppm");
++ system("ppmmix $n $tmpdir/junk1o$$.ppm $tmpdir/junk2o$$.ppm >$tmpdir/junk3$$.ppm");
+ } else {
+ my $n = $spline10[$i-20];
+- system("ppmmix $n junk2o$$.ppm junk2$$.ppm >junk3$$.ppm");
++ system("ppmmix $n $tmpdir/junk2o$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
+ }
+ if ($i == 10) {
+- system("ppmtopgm junk2$$.ppm | pgmbentley >junko$$.ppm");
+- system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " .
+- ">junk2o$$.ppm");
++ system("ppmtopgm $tmpdir/junk2$$.ppm | pgmbentley >$tmpdir/junko$$.ppm");
++ system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " .
++ ">$tmpdir/junk2o$$.ppm");
+ }
+ } elsif ($mode eq $BLOCK) {
+ if ($i <= 10) {
+ my $n = 1 - 1.9*$spline20[$i];
+- system("pamscale $n junk1$$.ppm | " .
+- "pamscale -width $width -height $height >junk3$$.ppm");
++ system("pamscale $n $tmpdir/junk1$$.ppm | " .
++ "pamscale -width $width -height $height >$tmpdir/junk3$$.ppm");
+ } elsif ($i <= 20) {
+ my $n = $spline10[$i-10];
+- system("ppmmix $n junk1a$$.ppm junk2a$$.ppm >junk3$$.ppm");
++ system("ppmmix $n $tmpdir/junk1a$$.ppm $tmpdir/junk2a$$.ppm >$tmpdir/junk3$$.ppm");
+ } else {
+ my $n = 1 - 1.9*$spline20[31-$i];
+- system("pamscale $n junk2$$.ppm | " .
+- "pamscale -width $width -height $height >junk3$$.ppm");
++ system("pamscale $n $tmpdir/junk2$$.ppm | " .
++ "pamscale -width $width -height $height >$tmpdir/junk3$$.ppm");
+ }
+ if ($i == 10) {
+- system("cp", "junk3$$.ppm", "junk1a$$.ppm");
+- system("pamscale $n junk2$$.ppm | " .
+- "pamscale -width $width -height $height >junk2a$$.ppm");
++ system("cp", "$tmpdir/junk3$$.ppm", "$tmpdir/junk1a$$.ppm");
++ system("pamscale $n $tmpdir/junk2$$.ppm | " .
++ "pamscale -width $width -height $height >$tmpdir/junk2a$$.ppm");
+ }
+ } elsif ($mode eq $MIX) {
+ my $fade_factor = sqrt(1/($nframes-$i+1));
+- system("ppmmix $fade_factor junk1$$.ppm junk2$$.ppm >junk3$$.ppm");
++ system("ppmmix $fade_factor $tmpdir/junk1$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
+ } else {
+ print("Internal error: impossible mode value '$mode'\n");
+ }
+
+ my $outfile = sprintf("%s.%04d.ppm", $base_name, $i);
+- system("cp", "junk3$$.ppm", $outfile);
++ system("cp", "$tmpdir/junk3$$.ppm", $outfile);
+ }
+
+ #
+ # Clean up shop.
+ #
+-system("rm junk*$$.ppm");
++system("rm $tmpdir/junk*$$.ppm");
+
+ exit(0);
+diff --git a/editor/ppmshadow b/editor/ppmshadow
+index 62cdf8b..72e1b22 100755
+--- a/editor/ppmshadow
++++ b/editor/ppmshadow
+@@ -97,9 +97,10 @@ sub makeConvolutionKernel($$) {
+
+
+ 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
+
+
diff --git a/manualPorts/netpbm/reproducible-man-gzip.patch b/manualPorts/netpbm/reproducible-man-gzip.patch
new file mode 100644
index 0000000..f6f4f0d
--- /dev/null
+++ b/manualPorts/netpbm/reproducible-man-gzip.patch
@@ -0,0 +1,16 @@
+diff -aur netpbm-10.73.31.old/buildtools/manpage.mk netpbm-10.73.31/buildtools/manpage.mk
+--- netpbm-10.73.31.old/buildtools/manpage.mk 2020-05-28 18:41:20.400790506 +0200
++++ netpbm-10.73.31/buildtools/manpage.mk 2020-05-28 18:50:50.444143414 +0200
+@@ -388,9 +388,9 @@
+ # This will install the generated man pages
+ installman:
+ set -x
+- for f in netpbm.1 $(MAN1); do if [ -f $$f ]; then gzip <$$f >$(MANDIR)/man1/$$f.gz; fi; done
+- for f in $(MAN3); do if [ -f $$f ]; then gzip <$$f >$(MANDIR)/man3/$$f.gz; fi; done
+- for f in $(MAN5); do if [ -f $$f ]; then gzip <$$f >$(MANDIR)/man5/$$f.gz; fi; done
++ for f in netpbm.1 $(MAN1); do if [ -f $$f ]; then gzip -n <$$f >$(MANDIR)/man1/$$f.gz; fi; done
++ for f in $(MAN3); do if [ -f $$f ]; then gzip -n <$$f >$(MANDIR)/man3/$$f.gz; fi; done
++ for f in $(MAN5); do if [ -f $$f ]; then gzip -n <$$f >$(MANDIR)/man5/$$f.gz; fi; done
+
+ # This will uninstall them
+ uninstallman:
diff --git a/manualPorts/netpbm/use-source-date-epoch.patch b/manualPorts/netpbm/use-source-date-epoch.patch
new file mode 100644
index 0000000..496935f
--- /dev/null
+++ b/manualPorts/netpbm/use-source-date-epoch.patch
@@ -0,0 +1,13 @@
+Only in netpbm-10.73.31/buildtools/: depend.mk
+diff -aur netpbm-10.73.31.old/buildtools/stamp-date netpbm-10.73.31/buildtools/stamp-date
+--- netpbm-10.73.31.old/buildtools/stamp-date 2020-05-30 17:34:29.833395465 +0200
++++ netpbm-10.73.31/buildtools/stamp-date 2020-05-30 17:48:52.910091897 +0200
+@@ -9,7 +9,7 @@
+ # documentation. This software is provided "as is" without express or
+ # implied warranty.
+ #
+-DATE=$(date)
++DATE="$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}")"
+ LOGNAME_OR_UNKNOWN=${LOGNAME:-UNKNOWN}
+ USER=${USER:-$LOGNAME_OR_UNKNOWN}
+ if [ "$USER" = "UNKNOWN" ]; then