[python-4Suite-XML] Fix build failure with -Werror=format-security

Miloslav Trmac mitr at fedoraproject.org
Tue Dec 3 18:21:56 UTC 2013


commit a9ee30b655b34cd21567dd0fbc10961693c5913b
Author: Miloslav Trmač <mitr at redhat.com>
Date:   Tue Dec 3 19:21:39 2013 +0100

    Fix build failure with -Werror=format-security

 python-4Suite-XML-1.0.2-format-string.patch |   21 +++++++++++++++++++++
 python-4Suite-XML.spec                      |    9 ++++++++-
 2 files changed, 29 insertions(+), 1 deletions(-)
---
diff --git a/python-4Suite-XML-1.0.2-format-string.patch b/python-4Suite-XML-1.0.2-format-string.patch
new file mode 100644
index 0000000..ee8e0cf
--- /dev/null
+++ b/python-4Suite-XML-1.0.2-format-string.patch
@@ -0,0 +1,21 @@
+diff -ur 4Suite-XML/Ft/Xml/src/StreamWriter.c 4Suite-XML-1.0.2/Ft/Xml/src/StreamWriter.c
+--- 4Suite-XML/Ft/Xml/src/StreamWriter.c	2006-09-24 20:11:21.000000000 +0200
++++ 4Suite-XML-1.0.2/Ft/Xml/src/StreamWriter.c	2013-12-03 19:02:39.157147468 +0100
+@@ -602,7 +602,7 @@
+ static int writer_print(PyStreamWriterObject *self, FILE *fp, int flags)
+ {
+   PyObject *repr = writer_repr(self);
+-  fprintf(fp, PyString_AS_STRING(repr));
++  fprintf(fp, "%s", PyString_AS_STRING(repr));
+   Py_DECREF(repr);
+   return 0;
+ }
+@@ -812,7 +812,7 @@
+ static int entitymap_print(PyEntityMapObject *self, FILE *fp, int flags)
+ {
+   PyObject *repr = entitymap_repr(self);
+-  fprintf(fp, PyString_AS_STRING(repr));
++  fprintf(fp, "%s", PyString_AS_STRING(repr));
+   Py_DECREF(repr);
+   return 0;
+ }
diff --git a/python-4Suite-XML.spec b/python-4Suite-XML.spec
index cb33123..de4fb57 100644
--- a/python-4Suite-XML.spec
+++ b/python-4Suite-XML.spec
@@ -2,7 +2,7 @@
 
 Name: python-4Suite-XML
 Version: 1.0.2
-Release: 17%{?dist}
+Release: 18%{?dist}
 Summary: A collection of XML-related technologies for Python
 
 Group: Development/Libraries
@@ -13,6 +13,8 @@ Source0: http://downloads.sourceforge.net/foursuite/4Suite-XML-%{version}.tar.bz
 Patch0: python-4Suite-XML-1.0.2-expat-dos.patch
 # https://sourceforge.net/tracker/?func=detail&aid=2959726&group_id=39954&atid=428294
 Patch1: python-4Suite-XML-1.0.2-tests-as.patch
+# https://sourceforge.net/p/foursuite/patches/20/
+Patch2: python-4Suite-XML-1.0.2-format-string.patch
 BuildRequires: python-devel
 
 %filter_provides_in %{python_sitearch}/Ft/.*\.so$
@@ -31,6 +33,7 @@ Its major components include the following:
 %setup -q -n 4Suite-XML-%{version}
 %patch0 -p1 -b .expat-dos
 %patch1 -p1 -b .tests-as
+%patch2 -p1 -b .format-string
 
 # https://sourceforge.net/tracker/?func=detail&aid=3429771&group_id=39954&atid=428292
 # Ft.Lib "can be used independently", but it needs stubmain.exe only when
@@ -70,6 +73,10 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/4Suite
 
 %changelog
+* Tue Dec  3 2013 Miloslav Trmač <mitr at redhat.com> - 1.0.2-18
+- Fix build failure with -Werror=format-security
+  Resolves: #1037260
+
 * Sun Aug 04 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.0.2-17
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
 


More information about the scm-commits mailing list