[ggz-gtk-client] Fix FTBFS with -Werror=format-security (#1037084, #1106530)

Yaakov Selkowitz yselkowitz at fedoraproject.org
Mon Jul 7 23:55:53 UTC 2014


commit 310afd529223683a7f60010364f4b1b7b271329e
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Mon Jun 16 19:15:23 2014 -0500

    Fix FTBFS with -Werror=format-security (#1037084, #1106530)

 ggz-gtk-client-0.99.5-format-security.patch |   70 +++++++++++++++++++++++++++
 ggz-gtk-client.spec                         |    7 ++-
 2 files changed, 76 insertions(+), 1 deletions(-)
---
diff --git a/ggz-gtk-client-0.99.5-format-security.patch b/ggz-gtk-client-0.99.5-format-security.patch
new file mode 100644
index 0000000..a7fc60d
--- /dev/null
+++ b/ggz-gtk-client-0.99.5-format-security.patch
@@ -0,0 +1,70 @@
+diff --git a/games/common/ggz_gtk.c b/games/common/ggz_gtk.c
+index db2b1dd..d3f792f 100644
+--- a/games/common/ggz_gtk.c
++++ b/games/common/ggz_gtk.c
+@@ -73,7 +73,7 @@ GGZMod *init_ggz_gtk(GtkWindow * main_window,
+ 	GGZMod *mod;
+ 
+ 	if (!ggzmod_is_ggz_mode()) {
+-		printf(_("This program should only be run from within GGZ."));
++		printf("%s", _("This program should only be run from within GGZ."));
+ 		printf("\n");
+ 		exit(1);
+ 	}
+diff --git a/games/dots/game.c b/games/dots/game.c
+index 9a9e032..a6cd14d 100644
+--- a/games/dots/game.c
++++ b/games/dots/game.c
+@@ -219,7 +219,7 @@ void board_handle_click(GtkWidget * widget, GdkEventButton * event)
+ 		if (ggz_write_int(game.fd, DOTS_SND_MOVE_V) < 0
+ 		    || ggz_write_char(game.fd, line_x) < 0
+ 		    || ggz_write_char(game.fd, top) < 0) {
+-			ggz_error_msg(_("Lost server connection"));
++			ggz_error_msg("%s", _("Lost server connection"));
+ 			exit(1);
+ 		}
+ 	} else {
+@@ -244,7 +244,7 @@ void board_handle_click(GtkWidget * widget, GdkEventButton * event)
+ 		if (ggz_write_int(game.fd, DOTS_SND_MOVE_H) < 0
+ 		    || ggz_write_char(game.fd, left) < 0
+ 		    || ggz_write_char(game.fd, line_y) < 0) {
+-			ggz_error_msg(_("Lost server connection"));
++			ggz_error_msg("%s", _("Lost server connection"));
+ 			exit(1);
+ 		}
+ 	}
+diff --git a/games/dots/main.c b/games/dots/main.c
+index 5ab208c..608f956 100644
+--- a/games/dots/main.c
++++ b/games/dots/main.c
+@@ -369,7 +369,7 @@ static int get_move_status(void)
+ 	}
+ 
+ 	if (status < 0)
+-		ggz_error_msg(_("Client cheater!"));
++		ggz_error_msg("%s", _("Client cheater!"));
+ 
+ 	return (int)status;
+ }
+diff --git a/games/ggzcards/game.c b/games/ggzcards/game.c
+index 536edf1..59c6bf3 100644
+--- a/games/ggzcards/game.c
++++ b/games/ggzcards/game.c
+@@ -289,7 +289,7 @@ void game_handle_gameover(int num_winners, int *winners)
+ 
+ 	/* handle different cases */
+ 	if (num_winners == 0)
+-		snprintf(msg, sizeof(msg), _("There was no winner."));
++		snprintf(msg, sizeof(msg), "%s", _("There was no winner."));
+ 	else {
+ 		int i;
+ 		for (i = 0; i < num_winners; i++) {
+@@ -307,7 +307,7 @@ void game_handle_gameover(int num_winners, int *winners)
+ 				 ggzcards.players[winners[i]].name);
+ 		}
+ 		snprintf(msg + strlen(msg), sizeof(msg) - strlen(msg),
+-			 _("won the game."));
++			 "%s", _("won the game."));
+ 	}
+ 
+ 	table_show_player_list();
diff --git a/ggz-gtk-client.spec b/ggz-gtk-client.spec
index f47f448..ef081c1 100644
--- a/ggz-gtk-client.spec
+++ b/ggz-gtk-client.spec
@@ -1,12 +1,13 @@
 Name:		ggz-gtk-client
 Version:	0.99.5
-Release:	10%{?dist}
+Release:	11%{?dist}
 Summary:        Gtk+ client libraries for GGZ gaming zone
 
 Group:		Development/Libraries    
 License:	GPLv2+
 URL:            http://www.ggzgamingzone.org/
 Source0:        http://mirrors.ibiblio.org/pub/mirrors/ggzgamingzone/ggz/snapshots/%{name}-snapshot-%{version}.tar.gz
+Patch0:         ggz-gtk-client-0.99.5-format-security.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:	ggz-base-libs-devel
@@ -41,6 +42,7 @@ developing applications that use %{name}.
 %if "%{_libdir}" != "/usr/lib"
 sed -i -e 's|"/lib /usr/lib|"/%{_lib} %{_libdir}|' configure
 %endif
+%patch0 -p1
 
 
 %build
@@ -97,6 +99,9 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Mon Jun 16 2014 Yaakov Selkowitz <yselkowi at redhat.com> - 0.99.5-11
+- Fix FTBFS with -Werror=format-security (#1037084, #1106530)
+
 * Sat Jun 07 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.99.5-10
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
 


More information about the scm-commits mailing list