[transfig] make it compile with -Werror=format-security (#1037365)
Kamil Dudka
kdudka at fedoraproject.org
Tue Dec 3 15:51:35 UTC 2013
commit f126f4cf9f153aea6ec45e41cc5da8df2b4191b0
Author: Kamil Dudka <kdudka at redhat.com>
Date: Tue Dec 3 16:48:34 2013 +0100
make it compile with -Werror=format-security (#1037365)
transfig-3.2.5d-bz1037365.patch | 71 +++++++++++++++++++++++++++++++++++++++
transfig.spec | 7 +++-
2 files changed, 77 insertions(+), 1 deletions(-)
---
diff --git a/transfig-3.2.5d-bz1037365.patch b/transfig-3.2.5d-bz1037365.patch
new file mode 100644
index 0000000..32c0b4d
--- /dev/null
+++ b/transfig-3.2.5d-bz1037365.patch
@@ -0,0 +1,71 @@
+From f9a1476538bcd46d38e0d8656c037f49bf4b042f Mon Sep 17 00:00:00 2001
+From: Kamil Dudka <kdudka at redhat.com>
+Date: Tue, 3 Dec 2013 16:27:20 +0100
+Subject: [PATCH] Resolves: #1037365 - make it compile with -Werror=format-security
+
+---
+ fig2dev/dev/gencgm.c | 2 +-
+ fig2dev/dev/genmp.c | 4 ++--
+ fig2dev/trans_spline.c | 4 ++--
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/fig2dev/dev/gencgm.c b/fig2dev/dev/gencgm.c
+index cdb28f9..83494de 100644
+--- a/fig2dev/dev/gencgm.c
++++ b/fig2dev/dev/gencgm.c
+@@ -139,7 +139,7 @@ gencgm_start(objects)
+
+ if (from) {
+ figname = malloc(strlen(from)+1);
+- sprintf(figname, from);
++ sprintf(figname, "%s", from);
+ p = strrchr(figname, '/');
+ if (p)
+ figname = p+1; /* remove path from name for comment in file */
+diff --git a/fig2dev/dev/genmp.c b/fig2dev/dev/genmp.c
+index 7697ce4..83c3b7f 100644
+--- a/fig2dev/dev/genmp.c
++++ b/fig2dev/dev/genmp.c
+@@ -1150,7 +1150,7 @@ F_text *t;
+ }
+ } else {
+ /* special text in latex mode: just write the text. */
+- fprintf(tfp, t->cstring);
++ fprintf(tfp, "%s", t->cstring);
+ }
+ fprintf(tfp," etex;\n");
+
+@@ -1164,7 +1164,7 @@ F_text *t;
+
+ fprintf(tfp," picture q;\n");
+ fprintf(tfp," q=thelabel.urt(\"");
+- fprintf(tfp, t->cstring);
++ fprintf(tfp, "%s", t->cstring);
+ fprintf(tfp, "\" infont ");
+ if (t->font<0) {
+ fprintf(tfp, "defaultfont");
+diff --git a/fig2dev/trans_spline.c b/fig2dev/trans_spline.c
+index 7c0da8f..c347fc1 100644
+--- a/fig2dev/trans_spline.c
++++ b/fig2dev/trans_spline.c
+@@ -648,7 +648,7 @@ create_cpoint()
+ F_control *cp;
+
+ if ((cp = (F_control *) malloc(CONTROL_SIZE)) == NULL)
+- fprintf(stderr,Err_mem);
++ put_msg(Err_mem);
+ return cp;
+ }
+
+@@ -659,7 +659,7 @@ create_line()
+ F_line *l;
+
+ if ((l = (F_line *) malloc(LINOBJ_SIZE)) == NULL)
+- fprintf(stderr,Err_mem);
++ put_msg(Err_mem);
+ l->pic = NULL;
+ l->next = NULL;
+ l->for_arrow = NULL;
+--
+1.7.1
+
diff --git a/transfig.spec b/transfig.spec
index 2f9ae50..54ed885 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: 12%{?dist}
+Release: 13%{?dist}
Epoch: 1
License: MIT
URL: http://www.xfig.org/
@@ -14,6 +14,7 @@ Patch2: transfig-3.2.5-bitmap.patch
Patch3: transfig-3.2.5d-bz728825.patch
Patch4: transfig-3.2.5-libpng.patch
Patch5: transfig-3.2.5d-CVE-2009-4227.patch
+Patch6: transfig-3.2.5d-bz1037365.patch
Requires: ghostscript
Requires: bc
@@ -42,6 +43,7 @@ figures into certain graphics languages.
%patch3 -p1
%patch4 -p1 -b .libpng
%patch5 -p1
+%patch6 -p1
# fix source permissions
find -type f -exec chmod -x {} \;
@@ -74,6 +76,9 @@ ln -s fig2ps2tex.1 %{buildroot}%{_mandir}/man1/fig2ps2tex.sh.1
%{_datadir}/fig2dev
%changelog
+* Tue Dec 03 2013 Kamil Dudka <kdudka at redhat.com> - 1:3.2.5d-13
+- make it compile with -Werror=format-security (#1037365)
+
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1:3.2.5d-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
More information about the scm-commits
mailing list