[w3m] Fix build with -Werror=format-security (rh#1037380)

pnemade pnemade at fedoraproject.org
Wed Dec 4 09:40:26 UTC 2013


commit 99f30870caac12a3949b6736aa70b7233f4414d5
Author: Parag Nemade <pnemade at redhat.com>
Date:   Wed Dec 4 15:10:17 2013 +0530

    Fix build with -Werror=format-security (rh#1037380)
    
    - Fix another FTBFS due to above flag (rh#1038009)

 w3m-0.5.3-FTBFS-sys-errlist.patch |   41 +++++++++++++++++++++++++++++++++++++
 w3m-0.5.3-format-security.patch   |   12 ++++++++++
 w3m.spec                          |   16 +++++++++++--
 3 files changed, 66 insertions(+), 3 deletions(-)
---
diff --git a/w3m-0.5.3-FTBFS-sys-errlist.patch b/w3m-0.5.3-FTBFS-sys-errlist.patch
new file mode 100644
index 0000000..649bc52
--- /dev/null
+++ b/w3m-0.5.3-FTBFS-sys-errlist.patch
@@ -0,0 +1,41 @@
+diff -urN w3m-0.5.3.old/etc.c w3m-0.5.3/etc.c
+--- w3m-0.5.3.old/etc.c	2011-01-04 14:52:20.000000000 +0530
++++ w3m-0.5.3/etc.c	2013-12-04 14:40:19.251408025 +0530
+@@ -634,24 +634,6 @@
+ }
+ #endif				/* not HAVE_STRERROR */
+ 
+-#ifndef HAVE_SYS_ERRLIST
+-char **sys_errlist;
+-
+-prepare_sys_errlist()
+-{
+-    int i, n;
+-
+-    i = 1;
+-    while (strerror(i) != NULL)
+-	i++;
+-    n = i;
+-    sys_errlist = New_N(char *, n);
+-    sys_errlist[0] = "";
+-    for (i = 1; i < n; i++)
+-	sys_errlist[i] = strerror(i);
+-}
+-#endif				/* not HAVE_SYS_ERRLIST */
+-
+ int
+ next_status(char c, int *status)
+ {
+diff -urN w3m-0.5.3.old/main.c w3m-0.5.3/main.c
+--- w3m-0.5.3.old/main.c	2013-12-04 14:39:30.746582875 +0530
++++ w3m-0.5.3/main.c	2013-12-04 14:40:02.597468050 +0530
+@@ -406,9 +406,6 @@
+     textdomain(PACKAGE);
+ #endif
+ 
+-#ifndef HAVE_SYS_ERRLIST
+-    prepare_sys_errlist();
+-#endif				/* not HAVE_SYS_ERRLIST */
+ 
+     NO_proxy_domains = newTextList();
+     fileToDelete = newTextList();
diff --git a/w3m-0.5.3-format-security.patch b/w3m-0.5.3-format-security.patch
new file mode 100644
index 0000000..d80dcd9
--- /dev/null
+++ b/w3m-0.5.3-format-security.patch
@@ -0,0 +1,12 @@
+diff -urN w3m-0.5.3.old/w3mbookmark.c w3m-0.5.3/w3mbookmark.c
+--- w3m-0.5.3.old/w3mbookmark.c	2011-01-04 14:52:24.000000000 +0530
++++ w3m-0.5.3/w3mbookmark.c	2013-12-03 21:34:33.907332176 +0530
+@@ -99,7 +99,7 @@
+ 	fprintf(f, "<body>\n<h1>Bookmarks</h1>\n");
+ 	fprintf(f, "<h2>%s</h2>\n<ul>\n", section);
+ 	fprintf(f, "<li><a href=\"%s\">%s</a>\n", url, title);
+-	fprintf(f, end_section);
++	fprintf(f, "%s", end_section);
+ 	fprintf(f, "</ul>\n</body>\n</html>\n");
+ 	fclose(f);
+     }
diff --git a/w3m.spec b/w3m.spec
index 97cceda..9b65fe7 100644
--- a/w3m.spec
+++ b/w3m.spec
@@ -9,7 +9,7 @@
 
 Name:     w3m
 Version:  0.5.3
-Release:  13%{?dist}
+Release:  14%{?dist}
 # UCD is added for EastAsianWidth.txt source
 License:  MIT and UCD
 URL:      http://w3m.sourceforge.net/
@@ -67,8 +67,13 @@ Patch4:  %{name}-rh707994-fix-https-segfault.patch
 #https://sourceforge.net/tracker/?group_id=39518&atid=425441
 Patch5:  %{name}-0.5.3-parallel-make.patch
 
+#https://bugzilla.redhat.com/show_bug.cgi?id=1037380
+Patch6:  %{name}-0.5.3-format-security.patch
+
+#https://bugzilla.redhat.com/show_bug.cgi?id=1038009
+Patch7:  %{name}-0.5.3-FTBFS-sys-errlist.patch
+
 Summary:  A pager with Web browsing abilities
-Group:    Applications/Internet
 Provides:  webclient
 Provides: text-www-browser
 
@@ -86,7 +91,6 @@ w3m-img package as well.
 
 %package img
 Summary: A helper program to display the inline images for w3m
-Group: Applications/Internet
 Requires: ImageMagick
 Requires: %{name} = %{version}-%{release}
 
@@ -106,6 +110,8 @@ chmod 755 doc-jp
 %patch3 -p1
 %patch4 -p0
 %patch5 -p1
+%patch6 -p1
+%patch7 -p1
 
 %if %{with_utf8}
 pushd doc-jp
@@ -173,6 +179,10 @@ rm -rf doc/CVS doc-jp/CVS
 %{_libexecdir}/w3m/w3mimgdisplay
 
 %changelog
+* Wed Dec 04 2013 Parag <pnemade AT redhat DOT com> - 0.5.3-14
+- Fix build with -Werror=format-security (rh#1037380)
+- Fix another FTBFS due to above flag (rh#1038009)
+
 * Sun Aug 04 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.5.3-13
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
 


More information about the scm-commits mailing list