From 4df816e1e02a7822eedbc40cff55ac5b9b245c4d Mon Sep 17 00:00:00 2001 From: Akinori Hattori Date: Tue, 18 Jul 2017 22:47:20 +0900 Subject: app-i18n/freewnn: fix build with -Werror=format-security Gentoo-Bug: 521056 Package-Manager: Portage-2.3.6, Repoman-2.3.1 --- .../freewnn/files/freewnn-Wformat-security.patch | 143 +++++++++++++++++++++ app-i18n/freewnn/freewnn-1.1.1_alpha22.ebuild | 5 +- 2 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 app-i18n/freewnn/files/freewnn-Wformat-security.patch (limited to 'app-i18n') diff --git a/app-i18n/freewnn/files/freewnn-Wformat-security.patch b/app-i18n/freewnn/files/freewnn-Wformat-security.patch new file mode 100644 index 000000000000..b5b68314060d --- /dev/null +++ b/app-i18n/freewnn/files/freewnn-Wformat-security.patch @@ -0,0 +1,143 @@ +--- a/Wnn/uum/jhlp.c ++++ b/Wnn/uum/jhlp.c +@@ -1135,7 +1135,7 @@ + else + { + signal (SIGCHLD, SIG_IGN); +- printf (MSG_GET (3)); ++ printf ("%s", MSG_GET (3)); + /* + printf("\r\nuumを終わります。\r\n"); + */ +@@ -1212,8 +1212,8 @@ + + if ((buf = (unsigned char *) malloc (maxchg * 4)) == NULL) + { +- printf (MSG_GET (2)); +- printf (MSG_GET (3)); ++ printf ("%s", MSG_GET (2)); ++ printf ("%s", MSG_GET (3)); + /* + printf("malloc に失敗しました。uumを終わります。\r\n"); + */ +--- a/Wnn/uum/jis_in.c ++++ b/Wnn/uum/jis_in.c +@@ -64,7 +64,7 @@ + + completely_start: + throw_c (0); /* モード表示の後に出す */ +- printf (MSG_GET (6)); ++ printf ("%s", MSG_GET (6)); + /* + printf("JISコード: "); + */ +--- a/Wnn/uum/jutil.c ++++ b/Wnn/uum/jutil.c +@@ -489,7 +489,7 @@ + /* + printf("只今、辞書を読み込んでいます。"); + */ +- printf (MSG_GET (60)); ++ printf ("%s", MSG_GET (60)); + flush (); + + 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) +@@ -571,7 +571,7 @@ + int x; + throw_c (0); + clr_line (); +- printf (string); ++ printf ("%s", string); + flush (); + for (;;) + { +--- a/Wnn/uum/kensaku.c ++++ b/Wnn/uum/kensaku.c +@@ -112,7 +112,7 @@ + u_s_on (); + w_printf (kana_buf, maxlength - strlen (MSG_GET (27)) - 2); + u_s_off (); +- printf (MSG_GET (27)); ++ printf ("%s", MSG_GET (27)); + flush (); + keyin (); + return (NULL); +--- a/Wnn/uum/kuten.c ++++ b/Wnn/uum/kuten.c +@@ -63,7 +63,7 @@ + + completely_start: + throw_c (0); /* モード表示の後に出す */ +- printf (MSG_GET (7)); ++ printf ("%s", MSG_GET (7)); + /* + printf("区点 : "); + */ +--- a/Wnn/uum/prologue.c ++++ b/Wnn/uum/prologue.c +@@ -144,7 +144,7 @@ + /* + fprintf(stderr,"初期化でmalloc不能。\n"); + */ +- fprintf (stderr, MSG_GET (2)); ++ fprintf (stderr, "%s", MSG_GET (2)); + return (-1); + } + +--- a/Wnn/uum/screen.c ++++ b/Wnn/uum/screen.c +@@ -547,7 +547,7 @@ + { + push_cursor (); + throw_c (0); +- printf (msg); ++ printf ("%s", msg); + pop_cursor (); + flush (); + } +--- a/Wnn/uum/sdefine.h ++++ b/Wnn/uum/sdefine.h +@@ -191,8 +191,8 @@ + + + #define flush() fflush(stdout) +-#define print_msg(X) {push_cursor();throw_c(0); clr_line();printf(X);flush();pop_cursor();} +-#define print_msg_getc(X) {push_cursor();throw_c(0); clr_line();printf(X);flush();keyin();pop_cursor();} ++#define print_msg(X) {push_cursor();throw_c(0); clr_line();printf("%s", X);flush();pop_cursor();} ++#define print_msg_getc(X) {push_cursor();throw_c(0); clr_line();printf("%s", X);flush();keyin();pop_cursor();} + + + #define UNDER_LINE_MODE (0x02 | 0x08 | 0x20) +--- a/Wnn/uum/select_ele.c ++++ b/Wnn/uum/select_ele.c +@@ -224,7 +224,7 @@ + + throw_c (0); + clr_line (); +- printf (msg); ++ printf ("%s", msg); + for (k = dd[cc]; k < dd[cc + 1]; k++) + { + cp = findcp (k, cc); +--- a/Wnn/uum/termio.c ++++ b/Wnn/uum/termio.c +@@ -100,7 +100,7 @@ + + if ((strlen (Term_Name) > 2) && (strcmp (Term_Name + (strlen (Term_Name) - 2), "-j") == 0)) + { +- fprintf (stderr, MSG_GET (4)); ++ fprintf (stderr, "%s", MSG_GET (4)); + /* + fprintf(stderr,"Uum:uumからuumはおこせません。\n"); + */ +--- a/Wnn/uum/wnnrc_op.c ++++ b/Wnn/uum/wnnrc_op.c +@@ -754,7 +754,7 @@ + return fp; + } + error: +- fprintf (stderr, MSG_GET (14)); ++ fprintf (stderr, "%s", MSG_GET (14)); + /* + fprintf(stderr , "uumrc ファイルがありません。"); + */ diff --git a/app-i18n/freewnn/freewnn-1.1.1_alpha22.ebuild b/app-i18n/freewnn/freewnn-1.1.1_alpha22.ebuild index 39f27f3bf6a9..f4d5668b35ee 100644 --- a/app-i18n/freewnn/freewnn-1.1.1_alpha22.ebuild +++ b/app-i18n/freewnn/freewnn-1.1.1_alpha22.ebuild @@ -16,7 +16,10 @@ IUSE="ipv6" S="${WORKDIR}/${MY_P}" -PATCHES=( "${FILESDIR}"/${P}-parallel-build.patch ) +PATCHES=( + "${FILESDIR}"/${P}-parallel-build.patch + "${FILESDIR}"/${PN}-Wformat-security.patch +) DOCS="ChangeLog* CONTRIBUTORS" src_prepare() { -- cgit v1.2.3-65-gdbad