pidgin: 089c261f: I noticed a NULL printf crash from the f...

markdoliner at pidgin.im markdoliner at pidgin.im
Mon Nov 22 05:00:33 EST 2010


----------------------------------------------------------------------
Revision: 089c261f1de00667abd623ce3c5b471e91b09016
Parent:   05ca7c0f8c782c05e9866a9ac6ccc03acc7d2c7f
Author:   markdoliner at pidgin.im
Date:     11/22/10 04:54:54
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/089c261f1de00667abd623ce3c5b471e91b09016

Changelog: 

I noticed a NULL printf crash from the first chunk of this change.
In the second chunk I changed the code to match the error message from
the first chunk.  I prefer this message.

Changes against parent 05ca7c0f8c782c05e9866a9ac6ccc03acc7d2c7f

  patched  libpurple/protocols/oscar/clientlogin.c

-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/clientlogin.c	94c6dd09616a8e8796556e7f66919851c6ba886b
+++ libpurple/protocols/oscar/clientlogin.c	30188d491ff7cf374cab732632f12a63b2ef4c5d
@@ -335,7 +335,8 @@ static void start_oscar_session_cb(Purpl
 		/* Note to translators: The first %s is a URL, the second is an
 		   error message. */
 		tmp = g_strdup_printf(_("Error requesting %s: %s"),
-				get_start_oscar_session_url(od), error_message);
+				get_start_oscar_session_url(od), error_message ?
+				error_message : _("The server returned an empty response"));
 		purple_connection_error_reason(gc,
 				PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
 		g_free(tmp);
@@ -568,12 +569,9 @@ static void client_login_cb(PurpleUtilFe
 
 	if (error_message != NULL || len == 0) {
 		gchar *tmp;
-		if (error_message != NULL)
-			tmp = g_strdup_printf(_("Error requesting %s: %s"),
-					get_client_login_url(od), error_message);
-		else
-			tmp = g_strdup_printf(_("Error requesting %s"),
-					get_client_login_url(od));
+		tmp = g_strdup_printf(_("Error requesting %s: %s"),
+				get_client_login_url(od), error_message ?
+				error_message : _("The server returned an empty response"));
 		purple_connection_error_reason(gc,
 				PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
 		g_free(tmp);


More information about the Commits mailing list