Gentoo Archives: gentoo-commits

From: Akinori Hattori <hattya@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-i18n/freewnn/, app-i18n/freewnn/files/
Date: Tue, 18 Jul 2017 13:53:36
Message-Id: 1500385979.4df816e1e02a7822eedbc40cff55ac5b9b245c4d.hattya@gentoo
1 commit: 4df816e1e02a7822eedbc40cff55ac5b9b245c4d
2 Author: Akinori Hattori <hattya <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jul 18 13:47:20 2017 +0000
4 Commit: Akinori Hattori <hattya <AT> gentoo <DOT> org>
5 CommitDate: Tue Jul 18 13:52:59 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4df816e1
7
8 app-i18n/freewnn: fix build with -Werror=format-security
9
10 Gentoo-Bug: 521056
11
12 Package-Manager: Portage-2.3.6, Repoman-2.3.1
13
14 .../freewnn/files/freewnn-Wformat-security.patch | 143 +++++++++++++++++++++
15 app-i18n/freewnn/freewnn-1.1.1_alpha22.ebuild | 5 +-
16 2 files changed, 147 insertions(+), 1 deletion(-)
17
18 diff --git a/app-i18n/freewnn/files/freewnn-Wformat-security.patch b/app-i18n/freewnn/files/freewnn-Wformat-security.patch
19 new file mode 100644
20 index 00000000000..b5b68314060
21 --- /dev/null
22 +++ b/app-i18n/freewnn/files/freewnn-Wformat-security.patch
23 @@ -0,0 +1,143 @@
24 +--- a/Wnn/uum/jhlp.c
25 ++++ b/Wnn/uum/jhlp.c
26 +@@ -1135,7 +1135,7 @@
27 + else
28 + {
29 + signal (SIGCHLD, SIG_IGN);
30 +- printf (MSG_GET (3));
31 ++ printf ("%s", MSG_GET (3));
32 + /*
33 + printf("\r\nuumを終わります。\r\n");
34 + */
35 +@@ -1212,8 +1212,8 @@
36 +
37 + if ((buf = (unsigned char *) malloc (maxchg * 4)) == NULL)
38 + {
39 +- printf (MSG_GET (2));
40 +- printf (MSG_GET (3));
41 ++ printf ("%s", MSG_GET (2));
42 ++ printf ("%s", MSG_GET (3));
43 + /*
44 + printf("malloc に失敗しました。uumを終わります。\r\n");
45 + */
46 +--- a/Wnn/uum/jis_in.c
47 ++++ b/Wnn/uum/jis_in.c
48 +@@ -64,7 +64,7 @@
49 +
50 + completely_start:
51 + throw_c (0); /* モード表示の後に出す */
52 +- printf (MSG_GET (6));
53 ++ printf ("%s", MSG_GET (6));
54 + /*
55 + printf("JISコード: ");
56 + */
57 +--- a/Wnn/uum/jutil.c
58 ++++ b/Wnn/uum/jutil.c
59 +@@ -489,7 +489,7 @@
60 + /*
61 + printf("只今、辞書を読み込んでいます。");
62 + */
63 +- printf (MSG_GET (60));
64 ++ printf ("%s", MSG_GET (60));
65 + flush ();
66 +
67 + if ((id = jl_dic_add (bun_data_, fname, hfname, 0, prio, rdonly, hrdonly, NULL, NULL, yes_or_no_or_newline, print_msg1)) == -1 && wnn_errorno != -1)
68 +@@ -571,7 +571,7 @@
69 + int x;
70 + throw_c (0);
71 + clr_line ();
72 +- printf (string);
73 ++ printf ("%s", string);
74 + flush ();
75 + for (;;)
76 + {
77 +--- a/Wnn/uum/kensaku.c
78 ++++ b/Wnn/uum/kensaku.c
79 +@@ -112,7 +112,7 @@
80 + u_s_on ();
81 + w_printf (kana_buf, maxlength - strlen (MSG_GET (27)) - 2);
82 + u_s_off ();
83 +- printf (MSG_GET (27));
84 ++ printf ("%s", MSG_GET (27));
85 + flush ();
86 + keyin ();
87 + return (NULL);
88 +--- a/Wnn/uum/kuten.c
89 ++++ b/Wnn/uum/kuten.c
90 +@@ -63,7 +63,7 @@
91 +
92 + completely_start:
93 + throw_c (0); /* モード表示の後に出す */
94 +- printf (MSG_GET (7));
95 ++ printf ("%s", MSG_GET (7));
96 + /*
97 + printf("区点 : ");
98 + */
99 +--- a/Wnn/uum/prologue.c
100 ++++ b/Wnn/uum/prologue.c
101 +@@ -144,7 +144,7 @@
102 + /*
103 + fprintf(stderr,"初期化でmalloc不能。\n");
104 + */
105 +- fprintf (stderr, MSG_GET (2));
106 ++ fprintf (stderr, "%s", MSG_GET (2));
107 + return (-1);
108 + }
109 +
110 +--- a/Wnn/uum/screen.c
111 ++++ b/Wnn/uum/screen.c
112 +@@ -547,7 +547,7 @@
113 + {
114 + push_cursor ();
115 + throw_c (0);
116 +- printf (msg);
117 ++ printf ("%s", msg);
118 + pop_cursor ();
119 + flush ();
120 + }
121 +--- a/Wnn/uum/sdefine.h
122 ++++ b/Wnn/uum/sdefine.h
123 +@@ -191,8 +191,8 @@
124 +
125 +
126 + #define flush() fflush(stdout)
127 +-#define print_msg(X) {push_cursor();throw_c(0); clr_line();printf(X);flush();pop_cursor();}
128 +-#define print_msg_getc(X) {push_cursor();throw_c(0); clr_line();printf(X);flush();keyin();pop_cursor();}
129 ++#define print_msg(X) {push_cursor();throw_c(0); clr_line();printf("%s", X);flush();pop_cursor();}
130 ++#define print_msg_getc(X) {push_cursor();throw_c(0); clr_line();printf("%s", X);flush();keyin();pop_cursor();}
131 +
132 +
133 + #define UNDER_LINE_MODE (0x02 | 0x08 | 0x20)
134 +--- a/Wnn/uum/select_ele.c
135 ++++ b/Wnn/uum/select_ele.c
136 +@@ -224,7 +224,7 @@
137 +
138 + throw_c (0);
139 + clr_line ();
140 +- printf (msg);
141 ++ printf ("%s", msg);
142 + for (k = dd[cc]; k < dd[cc + 1]; k++)
143 + {
144 + cp = findcp (k, cc);
145 +--- a/Wnn/uum/termio.c
146 ++++ b/Wnn/uum/termio.c
147 +@@ -100,7 +100,7 @@
148 +
149 + if ((strlen (Term_Name) > 2) && (strcmp (Term_Name + (strlen (Term_Name) - 2), "-j") == 0))
150 + {
151 +- fprintf (stderr, MSG_GET (4));
152 ++ fprintf (stderr, "%s", MSG_GET (4));
153 + /*
154 + fprintf(stderr,"Uum:uumからuumはおこせません。\n");
155 + */
156 +--- a/Wnn/uum/wnnrc_op.c
157 ++++ b/Wnn/uum/wnnrc_op.c
158 +@@ -754,7 +754,7 @@
159 + return fp;
160 + }
161 + error:
162 +- fprintf (stderr, MSG_GET (14));
163 ++ fprintf (stderr, "%s", MSG_GET (14));
164 + /*
165 + fprintf(stderr , "uumrc ファイルがありません。");
166 + */
167
168 diff --git a/app-i18n/freewnn/freewnn-1.1.1_alpha22.ebuild b/app-i18n/freewnn/freewnn-1.1.1_alpha22.ebuild
169 index 39f27f3bf6a..f4d5668b35e 100644
170 --- a/app-i18n/freewnn/freewnn-1.1.1_alpha22.ebuild
171 +++ b/app-i18n/freewnn/freewnn-1.1.1_alpha22.ebuild
172 @@ -16,7 +16,10 @@ IUSE="ipv6"
173
174 S="${WORKDIR}/${MY_P}"
175
176 -PATCHES=( "${FILESDIR}"/${P}-parallel-build.patch )
177 +PATCHES=(
178 + "${FILESDIR}"/${P}-parallel-build.patch
179 + "${FILESDIR}"/${PN}-Wformat-security.patch
180 +)
181 DOCS="ChangeLog* CONTRIBUTORS"
182
183 src_prepare() {