[t1lib] Fixed building with -Werror=format-security

Jaroslav Škarvada jskarvad at fedoraproject.org
Fri Dec 6 13:11:02 UTC 2013


commit 37f9ec839b2d6d49e65552b18c2c7e925fbd0916
Author: Jaroslav Škarvada <jskarvad at redhat.com>
Date:   Fri Dec 6 14:10:59 2013 +0100

    Fixed building with -Werror=format-security
    
      Resolves: rhbz#1037346
    - Fixed bogus dates in changelog (best effort)
    - Removed rpaths

 t1lib-5.1.2-format-security.patch |   26 ++++++++++++++++++++++++++
 t1lib.spec                        |   17 +++++++++++++++--
 2 files changed, 41 insertions(+), 2 deletions(-)
---
diff --git a/t1lib-5.1.2-format-security.patch b/t1lib-5.1.2-format-security.patch
new file mode 100644
index 0000000..86ef599
--- /dev/null
+++ b/t1lib-5.1.2-format-security.patch
@@ -0,0 +1,26 @@
+diff --git a/lib/type1/objects.h b/lib/type1/objects.h
+index 13cbae7..8ca37cc 100644
+--- a/lib/type1/objects.h
++++ b/lib/type1/objects.h
+@@ -214,7 +214,7 @@ struct xobject {
+ /*SHARED*/
+ /* NDW: personally, I want to see status and error messages! */
+ #define IfTrace0(condition,model)                                 \
+-        {if (condition) printf(model);}
++        {if (condition) printf("%s",model);}
+ #define IfTrace1(condition,model,arg0)                            \
+         {if (condition) printf(model,arg0);}
+ #define IfTrace2(condition,model,arg0,arg1)                       \
+diff --git a/lib/t1lib/t1subset.c b/lib/t1lib/t1subset.c
+index da427b2..e76974f 100644
+--- a/lib/t1lib/t1subset.c
++++ b/lib/t1lib/t1subset.c
+@@ -759,7 +759,7 @@ char *T1_SubsetFont( int FontID,
+ 	     tr_len);
+     T1_PrintLog( "T1_SubsetFont()", err_warn_msg_buf,
+ 		 T1LOG_DEBUG);
+-    l+=sprintf( &(trailerbuf[l]), linebuf); /* contains the PostScript trailer */
++    l+=sprintf( &(trailerbuf[l]), "%s", linebuf); /* contains the PostScript trailer */
+   }
+   
+   /* compute size of output file */
diff --git a/t1lib.spec b/t1lib.spec
index f0db353..cb400cd 100644
--- a/t1lib.spec
+++ b/t1lib.spec
@@ -1,6 +1,6 @@
 Name:           t1lib
 Version:        5.1.2
-Release:        13%{?dist}
+Release:        14%{?dist}
 
 Summary:        PostScript Type 1 font rasterizer
 
@@ -19,6 +19,7 @@ Patch3:         t1lib-5.1.2-type1-inv-rw-fix.patch
 # Add aarch64 support
 # https://bugzilla.redhat.com/show_bug.cgi?id=926603
 Patch4:         t1lib-5.1.2-aarch64.patch
+Patch5:         t1lib-5.1.2-format-security.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:  libXaw-devel
 
@@ -64,6 +65,7 @@ This package contains static libraries for %{name}.
 %patch2 -p1 -b .afm-fix
 %patch3 -p1 -b .type1-inv-rw-fix
 %patch4 -p1 -b .aarch64
+%patch5 -p1 -b .format-security
 
 # use debian patches directly instead of duplicating them
 #patch -p1 < debian/patches/segfault.diff -b -z .segf
@@ -78,6 +80,11 @@ mv Changes.utf8 Changes
 
 %build
 %configure
+
+# remove rpaths
+sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
+sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
+
 make %{?_smp_mflags} without_doc
 touch -r lib/t1lib/t1lib.h.in lib/t1lib.h
 touch -r lib/t1lib/t1libx.h lib/t1libx.h
@@ -150,6 +157,12 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Fri Dec  6 2013 Jaroslav Škarvada <jskarvad at redhat.com> - 5.1.2-14
+- Fixed building with -Werror=format-security
+  Resolves: rhbz#1037346
+- Fixed bogus dates in changelog (best effort)
+- Removed rpaths
+
 * Sun Aug 04 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 5.1.2-13
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
 
@@ -258,7 +271,7 @@ rm -rf $RPM_BUILD_ROOT
 * Sun May 22 2005 Jeremy Katz <katzj at redhat.com> - 5.0.2-3
 - rebuild on all arches
 
-* Fri Apr  7 2005 Michael Schwendt <mschwendt[AT]users.sf.net>
+* Thu Apr  7 2005 Michael Schwendt <mschwendt[AT]users.sf.net>
 - rebuilt
 
 * Thu Mar 11 2004 Marius L. Jøhndal <mariuslj at ifi.uio.no> - 0:5.0.2-0.fdr.1


More information about the scm-commits mailing list