[transfig] fix crash of fig2dev on a failure of ghostscript (#728825)

Kamil Dudka kdudka at fedoraproject.org
Tue Aug 9 09:29:15 UTC 2011


commit 7b54e9bcbae2fd2a1b6c948d9b6e6a6209e6a071
Author: Kamil Dudka <kdudka at redhat.com>
Date:   Tue Aug 9 11:25:03 2011 +0200

    fix crash of fig2dev on a failure of ghostscript (#728825)

 transfig-3.2.5d-bz728825.patch |   41 ++++++++++++++++++++++++++++++++++++++++
 transfig.spec                  |    7 +++++-
 2 files changed, 47 insertions(+), 1 deletions(-)
---
diff --git a/transfig-3.2.5d-bz728825.patch b/transfig-3.2.5d-bz728825.patch
new file mode 100644
index 0000000..34bae78
--- /dev/null
+++ b/transfig-3.2.5d-bz728825.patch
@@ -0,0 +1,41 @@
+From 422f2a135d904556a441210f16d22e1ee82baa1b Mon Sep 17 00:00:00 2001
+From: Kamil Dudka <kdudka at redhat.com>
+Date: Mon, 8 Aug 2011 11:43:29 +0200
+Subject: [PATCH] transfig - rhbz #728825
+
+---
+ fig2dev/dev/genpdf.c |    9 ++++++---
+ 1 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/fig2dev/dev/genpdf.c b/fig2dev/dev/genpdf.c
+index 37f4fe4..fe949ce 100644
+--- a/fig2dev/dev/genpdf.c
++++ b/fig2dev/dev/genpdf.c
+@@ -67,18 +67,21 @@ F_compound	*objects;
+ int
+ genpdf_end()
+ {
++	int	 status;
++
+ 	/* wrap up the postscript output */
+ 	if (genps_end() != 0)
+ 	    return -1;		/* error, return now */
+ 
+-	if (pclose(tfp) != 0) {
++	status = pclose(tfp);
++	/* we've already closed the original output file */
++	tfp = 0;
++	if (status != 0) {
+ 	    fprintf(stderr,"Error in ghostcript command\n");
+ 	    fprintf(stderr,"command was: %s\n", gscom);
+ 	    return -1;
+ 	}
+ 	(void) signal(SIGPIPE, SIG_DFL);
+-	/* we've already closed the original output file */
+-	tfp = 0;
+ 
+ 	/* all ok so far */
+ 
+-- 
+1.7.4.4
+
diff --git a/transfig.spec b/transfig.spec
index 1372369..e9a2a81 100644
--- a/transfig.spec
+++ b/transfig.spec
@@ -1,7 +1,7 @@
 Summary: Utility for converting FIG files (made by xfig) to other formats
 Name: transfig
 Version: 3.2.5d
-Release: 2%{?dist}
+Release: 3%{?dist}
 Epoch: 1
 License: MIT
 URL: http://www.xfig.org/
@@ -11,6 +11,7 @@ Source0: http://downloads.sourceforge.net/mcj/%{name}.%{version}.tar.gz
 Patch0: transfig-3.2.5-optflags.patch
 Patch1: transfig-3.2.5-modularX.patch
 Patch2: transfig-3.2.5-bitmap.patch
+Patch3: transfig-3.2.5d-bz728825.patch
 
 Requires:	ghostscript
 Requires:	bc
@@ -38,6 +39,7 @@ figures into certain graphics languages.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 # fix source permissions
 find -type f -exec chmod -x {} \;
@@ -75,6 +77,9 @@ rm -rf %{buildroot}
 %{_datadir}/fig2dev
 
 %changelog
+* Tue Aug 09 2011 Kamil Dudka <kdudka at redhat.com> - 1:3.2.5d-3
+- fix crash of fig2dev on a failure of ghostscript (#728825)
+
 * Wed Feb 09 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1:3.2.5d-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
 


More information about the scm-commits mailing list