From 02fb227dc3a8f3afd49f1003ef458763b4611d1a Mon Sep 17 00:00:00 2001 From: Jindrich Novy Date: Tue, 23 Dec 2008 20:37:42 +0000 Subject: [PATCH] - unbreak ppmshadow and ppmrainbow (#476989) - pnmmontage won't crash because of uninitialized memory usage --- netpbm-10.22-security2.patch | 2 +- netpbm-10.23-security.patch | 12 ------------ netpbm-10.35-pnmmontagefix.patch | 11 +++++++++++ netpbm.spec | 8 +++++++- 4 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 netpbm-10.35-pnmmontagefix.patch diff --git a/netpbm-10.22-security2.patch b/netpbm-10.22-security2.patch index 68a02d0..8628353 100644 --- a/netpbm-10.22-security2.patch +++ b/netpbm-10.22-security2.patch @@ -416,7 +416,7 @@ diff -up netpbm-10.35.48/editor/ppmshadow.security2 netpbm-10.35.48/editor/ppmsh -my $ourtmp = "$tmpdir/ppmshadow$$"; -mkdir($ourtmp, 0777) or - die("Unable to create directory for temporary files '$ourtmp"); -+chomp($ourtmp = `mktemp -d -t PPMshadow.XXXXXX`); ++my $ourtmp; chomp($ourtmp = `mktemp -d -t PPMshadow.XXXXXX`); +if ($? >> 8) { + die "Can't create directory for temporary files"; +} diff --git a/netpbm-10.23-security.patch b/netpbm-10.23-security.patch index 4c151cc..033b38e 100644 --- a/netpbm-10.23-security.patch +++ b/netpbm-10.23-security.patch @@ -1654,18 +1654,6 @@ diff -up netpbm-10.35.46/generator/pgmkernel.c.security netpbm-10.35.46/generato for (i = 0; i < iysize; i++) for (j = 0; j < ixsize; j++) { fkernel[i*ixsize+j] = 1.0 / (1.0 + w * sqrt((double) -diff -up netpbm-10.35.46/generator/ppmrainbow.security netpbm-10.35.46/generator/ppmrainbow ---- netpbm-10.35.46/generator/ppmrainbow.security 2008-06-24 08:58:57.000000000 +0200 -+++ netpbm-10.35.46/generator/ppmrainbow 2008-06-24 09:04:21.000000000 +0200 -@@ -11,7 +11,7 @@ my ($Twid, $Thgt, $tmpdir, $norepeat, $v - # set defaults - $Twid = 600; - $Thgt = 8; --$tmpdir = $ENV{"TMPDIR"} || "/tmp"; -+$tmpdir = $ENV{"TMPDIR"} || ".tmp"; - $norepeat = $FALSE; - $verbose = $FALSE; - diff -up netpbm-10.35.46/lib/libpam.c.security netpbm-10.35.46/lib/libpam.c --- netpbm-10.35.46/lib/libpam.c.security 2008-06-24 08:59:03.000000000 +0200 +++ netpbm-10.35.46/lib/libpam.c 2008-06-24 09:04:21.000000000 +0200 diff --git a/netpbm-10.35-pnmmontagefix.patch b/netpbm-10.35-pnmmontagefix.patch new file mode 100644 index 0000000..3b28fd8 --- /dev/null +++ b/netpbm-10.35-pnmmontagefix.patch @@ -0,0 +1,11 @@ +diff -up netpbm-10.35.57/editor/pnmmontage.c.pnmmontagefix netpbm-10.35.57/editor/pnmmontage.c +--- netpbm-10.35.57/editor/pnmmontage.c.pnmmontagefix 2008-12-15 10:04:29.000000000 +0100 ++++ netpbm-10.35.57/editor/pnmmontage.c 2008-12-23 20:09:01.000000000 +0100 +@@ -346,6 +346,7 @@ main(int argc, char **argv) + } + + pnm_readpaminit(imgs[0].file, &imgs[0], PAM_STRUCT_SIZE(tuple_type)); ++ memset(&outimg, 0, sizeof(outimg)); + outimg.maxval = imgs[0].maxval; + outimg.format = imgs[0].format; + memcpy(outimg.tuple_type, imgs[0].tuple_type, sizeof(imgs[0].tuple_type)); diff --git a/netpbm.spec b/netpbm.spec index 28174dc..db862be 100644 --- a/netpbm.spec +++ b/netpbm.spec @@ -1,7 +1,7 @@ Summary: A library for handling different graphics file formats Name: netpbm Version: 10.35.57 -Release: 2%{?dist} +Release: 3%{?dist} # See copyright_summary for details License: BSD and GPLv2 and IJG and MIT and Public Domain Group: System Environment/Libraries @@ -31,6 +31,7 @@ Patch18: netpbm-10.35-glibc.patch Patch19: netpbm-10.35-gcc43.patch Patch20: netpbm-10.35-rgbtxt.patch Patch21: netpbm-10.35-pamtosvgsegfault.patch +Patch22: netpbm-10.35-pnmmontagefix.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: libjpeg-devel, libpng-devel, libtiff-devel, flex BuildRequires: libX11-devel, python, jasper-devel @@ -92,6 +93,7 @@ netpbm-progs. You'll also need to install the netpbm package. %patch19 -p1 -b .gcc43 %patch20 -p1 -b .rgbtxt %patch21 -p1 -b .pamtosvgsegfault +%patch22 -p1 -b .pnmmontagefix ##mv shhopt/shhopt.h shhopt/pbmshhopt.h ##perl -pi -e 's|shhopt.h|pbmshhopt.h|g' `find -name "*.c" -o -name "*.h"` ./GNUmakefile @@ -219,6 +221,10 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/netpbm/ %changelog +* Tue Dec 23 2008 Jindrich Novy 10.35.57-3 +- unbreak ppmshadow and ppmrainbow (#476989) +- pnmmontage won't crash because of uninitialized memory usage + * Fri Dec 19 2008 Jindrich Novy 10.35.57-2 - fix segfault in pamtosvg caused by not reverting "sentinel value" (#476989)