pidgin: 22ac9cd3: Fix some cases where an arbitrary string...

datallah at pidgin.im datallah at pidgin.im
Fri Sep 17 10:47:36 EDT 2010


----------------------------------------------------------------------
Revision: 22ac9cd3908011eab0ad06c97353818f6eeaebf3
Parent:   8921eac26ae21b7e97796bbe7e616d4c4ed0f9c8
Author:   datallah at pidgin.im
Date:     09/17/10 10:40:13
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/22ac9cd3908011eab0ad06c97353818f6eeaebf3

Changelog: 

Fix some cases where an arbitrary string was being specified as a printf format.

Changes against parent 8921eac26ae21b7e97796bbe7e616d4c4ed0f9c8

  patched  libpurple/dnssrv.c
  patched  libpurple/network.c
  patched  libpurple/win32/libc_interface.c

-------------- next part --------------
============================================================
--- libpurple/win32/libc_interface.c	145a7fb7a70836074b5ef0e72e37025f1590073b
+++ libpurple/win32/libc_interface.c	a0773f4a42f99c38b30963a5eb54d60d91862bc8
@@ -317,26 +317,26 @@ char* wpurple_strerror(int errornum) {
 	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;
 }
============================================================
--- libpurple/network.c	040edad982c3770eb34822415ad9341218f66fa8
+++ libpurple/network.c	b5d913bea1b6c65c1dc41b7dae0f755ae882c787
@@ -693,7 +693,7 @@ static gboolean _print_debug_msg(gpointe
 
 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;
 }
============================================================
--- libpurple/dnssrv.c	bc973d891789794200b1c72a732ee8949f86fb43
+++ libpurple/dnssrv.c	1d94e35f4ea150180ff8cc5dfa325673e118cd1a
@@ -534,7 +534,7 @@ res_main_thread_cb(gpointer data)
 	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);


More information about the Commits mailing list