[wordnet] Pass compilation with -Werror=format-security
Petr Pisar
ppisar at fedoraproject.org
Wed Dec 4 15:09:37 UTC 2013
commit 563a60d341110d6bb3726d6494fd42314181f657
Author: Petr Písař <ppisar at redhat.com>
Date: Wed Dec 4 16:06:24 2013 +0100
Pass compilation with -Werror=format-security
...s-compilation-with-Werror-format-security.patch | 55 ++++++++++++++++++++
wordnet.spec | 8 +++-
2 files changed, 62 insertions(+), 1 deletions(-)
---
diff --git a/wordnet-3.0-Pass-compilation-with-Werror-format-security.patch b/wordnet-3.0-Pass-compilation-with-Werror-format-security.patch
new file mode 100644
index 0000000..9e37774
--- /dev/null
+++ b/wordnet-3.0-Pass-compilation-with-Werror-format-security.patch
@@ -0,0 +1,55 @@
+From ab6d29e9056173145cf49ebf9804e6caf2f870ea Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
+Date: Wed, 4 Dec 2013 15:58:30 +0100
+Subject: [PATCH] Pass compilation with -Werror=format-security
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+<https://bugzilla.redhat.com/show_bug.cgi?id=1037386>
+
+Signed-off-by: Petr Písař <ppisar at redhat.com>
+---
+ lib/binsrch.c | 4 ++--
+ src/wn.c | 3 +--
+ 2 files changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/lib/binsrch.c b/lib/binsrch.c
+index 8b71216..6b17325 100644
+--- a/lib/binsrch.c
++++ b/lib/binsrch.c
+@@ -193,7 +193,7 @@ char *replace_line(char *new_line, char *searchkey, FILE *fp)
+ copyfile(fp, tfp);
+ if (fseek(fp, offset, 0) == -1)
+ return(NULL); /* could not seek to offset */
+- fprintf(fp, new_line); /* write line */
++ fputs(new_line, fp); /* write line */
+ rewind(tfp);
+ copyfile(tfp, fp);
+
+@@ -220,7 +220,7 @@ char *insert_line(char *new_line, char *searchkey, FILE *fp)
+ copyfile(fp, tfp);
+ if (fseek(fp, offset, 0) == -1)
+ return(NULL); /* could not seek to offset */
+- fprintf(fp, new_line); /* write line */
++ fputs(new_line, fp); /* write line */
+ rewind(tfp);
+ copyfile(tfp, fp);
+
+diff --git a/src/wn.c b/src/wn.c
+index 6870a60..7eef283 100644
+--- a/src/wn.c
++++ b/src/wn.c
+@@ -284,8 +284,7 @@ static void printsearches(char *word, int dbase, unsigned long search)
+ printf("\t");
+ printf(searchstr[j].template,
+ partchars[dbase], partchars[dbase]);
+- printf(searchstr[j].helpstr);
+- printf("\n");
++ printf("%s\n", searchstr[j].helpstr);
+ }
+ }
+
+--
+1.8.3.1
+
diff --git a/wordnet.spec b/wordnet.spec
index 73bcdff..49abc1f 100644
--- a/wordnet.spec
+++ b/wordnet.spec
@@ -1,6 +1,6 @@
Name: wordnet
Version: 3.0
-Release: 20%{?dist}
+Release: 21%{?dist}
Summary: A lexical database for the English language
Group: Applications/Text
@@ -18,6 +18,8 @@ Patch6: wordnet-3.0-use_system_tk_headers.patch
Patch7: wordnet-3.0-libtool.patch
# Bug #585206
Patch8: wordnet-3.0-error_message.patch
+# Bug #1037386
+Patch9: wordnet-3.0-Pass-compilation-with-Werror-format-security.patch
BuildRequires: automake >= 1.8
BuildRequires: libtool
BuildRequires: tcl-devel
@@ -76,6 +78,7 @@ sed -e '/man_MANS/ s/$/ wishwn.1/' -i doc/man/Makefile.am
%patch6 -p1 -b .use_system_tk_headers
%patch7 -p1 -b .libtool
%patch8 -p1 -b .error_message
+%patch9 -p1 -b .format
# delete the include/tk dir, since we do not use the included tk headers
rm -rf include/tk
@@ -131,6 +134,9 @@ rm -rf doc/{html,ps,pdf}/Makefile*
%changelog
+* Wed Dec 04 2013 Petr Pisar <ppisar at redhat.com> - 3.0-21
+- Pass compilation with -Werror=format-security (bug #1037386)
+
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.0-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
More information about the scm-commits
mailing list