pidgin: df86c6f1: Prevent a NULL printf crash.

datallah at pidgin.im datallah at pidgin.im
Sun Nov 23 22:25:22 EST 2008


-----------------------------------------------------------------
Revision: df86c6f1de324e87828356aa8d5c369abd533b58
Ancestor: ff33fd0d52d8b32701b296048df6105a5c70e554
Author: datallah at pidgin.im
Date: 2008-11-24T03:23:25
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/df86c6f1de324e87828356aa8d5c369abd533b58

Modified files:
        libpurple/proxy.c

ChangeLog: 

Prevent a NULL printf crash.
This probably wont actually ever authenticate successfully in the situation
where it would have crashed, but at least it wont crash.
Fixes #7526

-------------- next part --------------
============================================================
--- libpurple/proxy.c	8f37a759f25088bde3743c53fd577037a46f2bff
+++ libpurple/proxy.c	d66709a168339a364681abcc819b8a67dc5f4669
@@ -944,12 +944,15 @@ http_canread(gpointer data, gint source,
 
 			} else if((header = g_strrstr((const char *)connect_data->read_buffer, "Proxy-Authenticate: Basic"))) {
 				gchar *t1, *t2;
+				const char *username, *password;
 
+				username = purple_proxy_info_get_username(connect_data->gpi);
+				password = purple_proxy_info_get_password(connect_data->gpi);
+
 				t1 = g_strdup_printf("%s:%s",
-					purple_proxy_info_get_username(connect_data->gpi),
-					purple_proxy_info_get_password(connect_data->gpi) ?
-					purple_proxy_info_get_password(connect_data->gpi) : "");
-				t2 = purple_base64_encode((const guchar *)t1, strlen(t1));
+									 username ? username : "",
+									 password ? password : "");
+				t2 = purple_base64_encode((guchar *)t1, strlen(t1));
 				g_free(t1);
 
 				request = g_strdup_printf(


More information about the Commits mailing list