changeset 30550:47ea27481972

Fix some cases where an arbitrary string was being specified as a printf format.
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 17 Sep 2010 14:40:13 +0000
parents fcb8fad4f029
children 7f79ac13965c
files libpurple/dnssrv.c libpurple/network.c libpurple/win32/libc_interface.c
diffstat 3 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/dnssrv.c	Fri Sep 17 14:32:31 2010 +0000
+++ b/libpurple/dnssrv.c	Fri Sep 17 14:40:13 2010 +0000
@@ -534,7 +534,7 @@
 	PurpleSrvResponse *srvres = NULL;
 	PurpleSrvQueryData *query_data = data;
 	if(query_data->error_message != NULL) {
-		purple_debug_error("dnssrv", query_data->error_message);
+		purple_debug_error("dnssrv", "%s", query_data->error_message);
 		if (query_data->type == DNS_TYPE_SRV) {
 			if (query_data->cb.srv)
 				query_data->cb.srv(srvres, 0, query_data->extradata);
--- a/libpurple/network.c	Fri Sep 17 14:32:31 2010 +0000
+++ b/libpurple/network.c	Fri Sep 17 14:40:13 2010 +0000
@@ -693,7 +693,7 @@
 
 static gboolean _print_debug_msg(gpointer data) {
 	gchar *msg = data;
-	purple_debug_warning("network", msg);
+	purple_debug_warning("network", "%s", msg);
 	g_free(msg);
 	return FALSE;
 }
--- a/libpurple/win32/libc_interface.c	Fri Sep 17 14:32:31 2010 +0000
+++ b/libpurple/win32/libc_interface.c	Fri Sep 17 14:40:13 2010 +0000
@@ -317,26 +317,26 @@
 	if (errornum > WSABASEERR) {
 		switch(errornum) {
 			case WSAECONNABORTED: /* 10053 */
-				g_snprintf(errbuf, sizeof(errbuf), _("Connection interrupted by other software on your computer."));
+				g_snprintf(errbuf, sizeof(errbuf), "%s", _("Connection interrupted by other software on your computer."));
 				break;
 			case WSAECONNRESET: /* 10054 */
-				g_snprintf(errbuf, sizeof(errbuf), _("Remote host closed connection."));
+				g_snprintf(errbuf, sizeof(errbuf), "%s", _("Remote host closed connection."));
 				break;
 			case WSAETIMEDOUT: /* 10060 */
-				g_snprintf(errbuf, sizeof(errbuf), _("Connection timed out."));
+				g_snprintf(errbuf, sizeof(errbuf), "%s", _("Connection timed out."));
 				break;
 			case WSAECONNREFUSED: /* 10061 */
-				g_snprintf(errbuf, sizeof(errbuf), _("Connection refused."));
+				g_snprintf(errbuf, sizeof(errbuf), "%s", _("Connection refused."));
 				break;
 			case WSAEADDRINUSE: /* 10048 */
-				g_snprintf(errbuf, sizeof(errbuf), _("Address already in use."));
+				g_snprintf(errbuf, sizeof(errbuf), "%s", _("Address already in use."));
 				break;
 			default:
 				g_snprintf(errbuf, sizeof(errbuf), "Windows socket error #%d", errornum);
 		}
 	} else {
 		const char *tmp = g_strerror(errornum);
-		g_snprintf(errbuf, sizeof(errbuf), tmp);
+		g_snprintf(errbuf, sizeof(errbuf), "%s", tmp);
 	}
 	return errbuf;
 }