- fix segfault in pnmsmooth (#545089)
This commit is contained in:
parent
e335a42392
commit
1b90006cfb
66
netpbm-pnmsmooth-segfault.patch
Normal file
66
netpbm-pnmsmooth-segfault.patch
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
diff -up netpbm-10.47.04/editor/pnmsmooth.c.pnmsmooth-segfault netpbm-10.47.04/editor/pnmsmooth.c
|
||||||
|
--- netpbm-10.47.04/editor/pnmsmooth.c.pnmsmooth-segfault 2009-10-21 13:38:57.000000000 +0200
|
||||||
|
+++ netpbm-10.47.04/editor/pnmsmooth.c 2009-03-23 07:55:01.000000000 +0100
|
||||||
|
@@ -23,12 +23,12 @@
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <errno.h>
|
||||||
|
+#include <sys/wait.h>
|
||||||
|
|
||||||
|
#include "pm_c_util.h"
|
||||||
|
#include "mallocvar.h"
|
||||||
|
#include "shhopt.h"
|
||||||
|
#include "nstring.h"
|
||||||
|
-#include "pm_system.h"
|
||||||
|
#include "pnm.h"
|
||||||
|
|
||||||
|
|
||||||
|
@@ -176,6 +176,38 @@ writeConvolutionImage(FILE * const
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
+static void
|
||||||
|
+runPnmconvol(const char * const inputFilespec,
|
||||||
|
+ const char * const convolutionImageFilespec) {
|
||||||
|
+
|
||||||
|
+ /* fork a Pnmconvol process */
|
||||||
|
+ pid_t rc;
|
||||||
|
+
|
||||||
|
+ rc = fork();
|
||||||
|
+ if (rc < 0)
|
||||||
|
+ pm_error("fork() failed. errno=%d (%s)", errno, strerror(errno));
|
||||||
|
+ else if (rc == 0) {
|
||||||
|
+ /* child process executes following code */
|
||||||
|
+
|
||||||
|
+ execlp("pnmconvol",
|
||||||
|
+ "pnmconvol", convolutionImageFilespec, inputFilespec,
|
||||||
|
+ NULL);
|
||||||
|
+
|
||||||
|
+ pm_error("error executing pnmconvol command. errno=%d (%s)",
|
||||||
|
+ errno, strerror(errno));
|
||||||
|
+ } else {
|
||||||
|
+ /* This is the parent */
|
||||||
|
+ pid_t const childPid = rc;
|
||||||
|
+
|
||||||
|
+ int status;
|
||||||
|
+
|
||||||
|
+ /* wait for child to finish */
|
||||||
|
+ while (wait(&status) != childPid);
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+
|
||||||
|
int
|
||||||
|
main(int argc, char ** argv) {
|
||||||
|
|
||||||
|
@@ -200,8 +232,7 @@ main(int argc, char ** argv) {
|
||||||
|
if (cmdline.dump) {
|
||||||
|
/* We're done. Convolution image is in user's file */
|
||||||
|
} else {
|
||||||
|
- pm_system_lp("pnmconvol", NULL, NULL, NULL, NULL,
|
||||||
|
- tempfileName, cmdline.inputFilespec, NULL);
|
||||||
|
+ runPnmconvol(cmdline.inputFilespec, tempfileName);
|
||||||
|
|
||||||
|
unlink(tempfileName);
|
||||||
|
strfree(tempfileName);
|
12
netpbm.spec
12
netpbm.spec
@ -1,13 +1,13 @@
|
|||||||
Summary: A library for handling different graphics file formats
|
Summary: A library for handling different graphics file formats
|
||||||
Name: netpbm
|
Name: netpbm
|
||||||
Version: 10.47.04
|
Version: 10.47.04
|
||||||
Release: 2%{?dist}
|
Release: 3%{?dist}
|
||||||
# See copyright_summary for details
|
# See copyright_summary for details
|
||||||
License: BSD and GPLv2 and IJG and MIT and Public Domain
|
License: BSD and GPLv2 and IJG and MIT and Public Domain
|
||||||
Group: System Environment/Libraries
|
Group: System Environment/Libraries
|
||||||
URL: http://netpbm.sourceforge.net/
|
URL: http://netpbm.sourceforge.net/
|
||||||
# Source0 is prepared by
|
# Source0 is prepared by
|
||||||
# svn checkout https://netpbm.svn.sourceforge.net/svnroot/netpbm/super_stable netpbm-%{version}
|
# svn checkout https://netpbm.svn.sourceforge.net/svnroot/netpbm/stable netpbm-%{version}
|
||||||
# svn checkout https://netpbm.svn.sourceforge.net/svnroot/netpbm/userguide netpbm-%{version}/userguide
|
# svn checkout https://netpbm.svn.sourceforge.net/svnroot/netpbm/userguide netpbm-%{version}/userguide
|
||||||
# and removing the .svn directories
|
# and removing the .svn directories
|
||||||
Source0: netpbm-%{version}.tar.xz
|
Source0: netpbm-%{version}.tar.xz
|
||||||
@ -27,6 +27,7 @@ Patch13: netpbm-glibc.patch
|
|||||||
Patch14: netpbm-pnmtofiasco-stdin.patch
|
Patch14: netpbm-pnmtofiasco-stdin.patch
|
||||||
Patch15: netpbm-svgtopam.patch
|
Patch15: netpbm-svgtopam.patch
|
||||||
Patch16: netpbm-ppmpat-segfault.patch
|
Patch16: netpbm-ppmpat-segfault.patch
|
||||||
|
Patch17: netpbm-pnmsmooth-segfault.patch
|
||||||
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
BuildRequires: libjpeg-devel, libpng-devel, libtiff-devel, flex
|
BuildRequires: libjpeg-devel, libpng-devel, libtiff-devel, flex
|
||||||
BuildRequires: libX11-devel, python, jasper-devel
|
BuildRequires: libX11-devel, python, jasper-devel
|
||||||
@ -84,6 +85,7 @@ netpbm-progs. You'll also need to install the netpbm package.
|
|||||||
%patch14 -p1 -b .pnmtofiasco-stdin
|
%patch14 -p1 -b .pnmtofiasco-stdin
|
||||||
%patch15 -p1 -b .svgtopam
|
%patch15 -p1 -b .svgtopam
|
||||||
%patch16 -p1 -b .ppmpat-segfault
|
%patch16 -p1 -b .ppmpat-segfault
|
||||||
|
%patch17 -p1 -b .pnmsmooth-segfault
|
||||||
|
|
||||||
sed -i 's/STRIPFLAG = -s/STRIPFLAG =/g' config.mk.in
|
sed -i 's/STRIPFLAG = -s/STRIPFLAG =/g' config.mk.in
|
||||||
|
|
||||||
@ -111,11 +113,10 @@ sed -i 's/STRIPFLAG = -s/STRIPFLAG =/g' config.mk.in
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
TOP=`pwd`
|
TOP=`pwd`
|
||||||
# CFLAGS="$RPM_OPT_FLAGS -fPIC -flax-vector-conversions" \
|
|
||||||
make \
|
make \
|
||||||
CC="%{__cc}" \
|
CC="%{__cc}" \
|
||||||
LDFLAGS="-L$TOP/pbm -L$TOP/pgm -L$TOP/pnm -L$TOP/ppm" \
|
LDFLAGS="-L$TOP/pbm -L$TOP/pgm -L$TOP/pnm -L$TOP/ppm" \
|
||||||
CFLAGS="-g3 -fPIC -flax-vector-conversions" \
|
CFLAGS="$RPM_OPT_FLAGS -fPIC -flax-vector-conversions" \
|
||||||
LADD="-lm" \
|
LADD="-lm" \
|
||||||
JPEGINC_DIR=%{_includedir} \
|
JPEGINC_DIR=%{_includedir} \
|
||||||
PNGINC_DIR=%{_includedir} \
|
PNGINC_DIR=%{_includedir} \
|
||||||
@ -213,6 +214,9 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%{_datadir}/netpbm/
|
%{_datadir}/netpbm/
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Dec 7 2009 Jindrich Novy <jnovy@redhat.com> 10.47.04-3
|
||||||
|
- fix segfault in pnmsmooth (#545089)
|
||||||
|
|
||||||
* Fri Nov 27 2009 Jindrich Novy <jnovy@redhat.com> 10.47.04-2
|
* Fri Nov 27 2009 Jindrich Novy <jnovy@redhat.com> 10.47.04-2
|
||||||
- fix ppmpat segfault when using -camo option (#541568)
|
- fix ppmpat segfault when using -camo option (#541568)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user