1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
From: Youhei SASAKI <uwabami@gfd-dennou.org>
Date: Sun, 25 Mar 2012 16:28:28 +0900
Subject: Werror Format Security
Signed-off-by: Youhei SASAKI <uwabami@gfd-dennou.org>
---
texk/xdvik/gui/message-window.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/texk/xdvik/gui/message-window.c b/texk/xdvik/gui/message-window.c
index 093ee33..3260df7 100644
--- a/texk/xdvik/gui/message-window.c
+++ b/texk/xdvik/gui/message-window.c
@@ -713,7 +713,7 @@ internal_popup_window(Widget parent,
Widget ret;
ASSERT(type < (sizeof my_msg_map / sizeof my_msg_map[0]), "too few elements in my_msg_map");
- sprintf(win_title, my_msg_map[type].window_title);
+ sprintf(win_title, "%s", my_msg_map[type].window_title);
#if DEBUG
fprintf(stderr, "internal_popup_window called with prompt: \"%s\"\n", msg_buf);
@@ -725,11 +725,11 @@ internal_popup_window(Widget parent,
supposed to be printf-format strings (i.e. with doubled `%' to escape them)
*/
fprintf(stderr, "\n%s:\n", my_msg_map[type].window_title);
- fprintf(stderr, msg_buf);
+ fprintf(stderr, "%s", msg_buf);
fprintf(stderr, "\n");
if (helptext) {
fprintf(stderr, "---------- helptext ----------\n");
- fprintf(stderr, helptext);
+ fprintf(stderr, "%s", helptext);
fprintf(stderr, "\n---------- end of helptext ----------\n");
}
return NULL;
@@ -741,7 +741,7 @@ internal_popup_window(Widget parent,
if (my_popup_num == MAX_POPUPS) {
/* already enough popups on screen, just dump it to stderr */
fprintf(stderr, "%s: ", win_title);
- fprintf(stderr, msg_buf);
+ fprintf(stderr, "%s", msg_buf);
fputc('\n', stderr);
/* Note: If a mad function continues to open popups, this will
* stop after MAX_POPUPS, but open a new window for each
|