[ayttm] Fix FTBFS with -Werror=format-security (#1036996, #1105991)

Yaakov Selkowitz yselkowitz at fedoraproject.org
Tue Jul 22 20:33:13 UTC 2014


commit 60a2c4181be02ed7d76a0d7d44ed280a605fc0e8
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Tue Jul 22 15:32:50 2014 -0500

    Fix FTBFS with -Werror=format-security (#1036996, #1105991)

 ayttm-format-security.patch |   70 +++++++++++++++++++++++++++++++++++++++++++
 ayttm.spec                  |    7 ++++-
 2 files changed, 76 insertions(+), 1 deletions(-)
---
diff --git a/ayttm-format-security.patch b/ayttm-format-security.patch
new file mode 100644
index 0000000..da0e556
--- /dev/null
+++ b/ayttm-format-security.patch
@@ -0,0 +1,70 @@
+--- a/libproxy/proxy.c
++++ b/libproxy/proxy.c
+@@ -311,7 +311,7 @@ int http_connect(int sockfd, const char *host, int port, AyProxyData *proxy)
+ 	strncat(cmd, "\r\n", remaining);
+ #ifndef DEBUG
+ 	snprintf(debug_buff, sizeof(debug_buff), "<%s>\n", cmd);
+-	debug_print(debug_buff);
++	debug_print("%s", debug_buff);
+ #endif
+ 	if (send(sockfd, cmd, strlen(cmd), 0) < 0)
+ 		return AY_CONNECTION_REFUSED;
+@@ -319,7 +319,7 @@ int http_connect(int sockfd, const char *host, int port, AyProxyData *proxy)
+ 		return AY_CONNECTION_REFUSED;
+ #ifndef DEBUG
+ 	snprintf(debug_buff, sizeof(debug_buff), "<%s>\n", inputline);
+-	debug_print(debug_buff);
++	debug_print("%s", debug_buff);
+ #endif
+ 	if (!strstr(inputline, "200")) {
+ 		/* Check if proxy authorization needed */
+@@ -346,7 +346,7 @@ int http_connect(int sockfd, const char *host, int port, AyProxyData *proxy)
+ 		}
+ #ifndef DEBUG
+ 		snprintf(debug_buff, sizeof(debug_buff), "<%s>\n", inputline);
+-		debug_print(debug_buff);
++		debug_print("%s", debug_buff);
+ #endif
+ 	}
+ 	free(inputline);
+--- a/src/edit_list_window.c
++++ b/src/edit_list_window.c
+@@ -372,23 +372,19 @@ static void write_data()
+ 	while (data_list) {
+ 		my_data = (data *)data_list->data;
+ 
+-		fprintf(fp, bentity);
+-		fprintf(fp, "\n");
++		fprintf(fp, "%s\n", bentity);
+ 		fprintf(fp, "<TITLE>\n");
+ 		strncpy(buff2, my_data->title, strlen(my_data->title) + 1);
+ 		g_strchomp(buff2);
+ 		fprintf(fp, "%s\n", buff2);
+ 		fprintf(fp, "</TITLE>\n");
+-		fprintf(fp, bvalue);
+-		fprintf(fp, "\n");
++		fprintf(fp, "%s\n", bvalue);
+ 		strncpy(buff2, my_data->message->str,
+ 			strlen(my_data->message->str) + 1);
+ 		g_strchomp(buff2);
+ 		fprintf(fp, "%s\n", buff2);
+-		fprintf(fp, evalue);
+-		fprintf(fp, "\n");
+-		fprintf(fp, eentity);
+-		fprintf(fp, "\n");
++		fprintf(fp, "%s\n", evalue);
++		fprintf(fp, "%s\n", eentity);
+ 
+ 		data_list = data_list->next;
+ 	}
+--- a/src/messages.c
++++ b/src/messages.c
+@@ -45,7 +45,7 @@ static void ay_do_message(const char *inTitle, const char *inMessage,
+ 	}
+ 
+ 	dialog = gtk_message_dialog_new_with_markup(NULL, flags, mtype,
+-		GTK_BUTTONS_OK, inMessage);
++		GTK_BUTTONS_OK, "%s", inMessage);
+ 	gtk_window_set_title(GTK_WINDOW(dialog), inTitle);
+ 	gtk_widget_show(dialog);
+ 
diff --git a/ayttm.spec b/ayttm.spec
index c0e0238..6270e31 100644
--- a/ayttm.spec
+++ b/ayttm.spec
@@ -1,11 +1,12 @@
 Summary: Universal Instant Messaging Client
 Name: ayttm
 Version: 0.6.3
-Release: 9%{?dist}
+Release: 10%{?dist}
 Group: Applications/Internet
 License: GPLv2+ and LGPLv2+
 URL: http://ayttm.sourceforge.net/
 Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2
+Patch0: ayttm-format-security.patch
 
 BuildRequires: flex
 BuildRequires: bison
@@ -33,6 +34,7 @@ messages through AOL, ICQ, Yahoo, MSN, IRC and Jabber.
 %prep
 
 %setup -q -n %{name}-%{version}
+%patch0 -p1 -b .format
 
 tr -d '\r' < AUTHORS > AUTHORS.new
 iconv -f ISO-8859-2 -t UTF-8 AUTHORS.new > AUTHORS
@@ -69,6 +71,9 @@ $RPM_BUILD_ROOT/%{_datadir}/applnk/Internet/%{name}.desktop
 %exclude %{_datadir}/gnome/apps/Internet/ayttm.desktop
 
 %changelog
+* Tue Jul 22 2014 Yaakov Selkowitz <yselkowi at redhat.com> - 0.6.3-10
+- Fix FTBFS with -Werror=format-security (#1036996, #1105991)
+
 * Sat Jun 07 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.6.3-9
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
 


More information about the scm-commits mailing list