[evolution-data-server/gnome-2-28] Bug #602719 - Crash in ep_set_proxy with no proxy user or password



commit 44b51cf07e086641dd5cac893a58c6a6a87de259
Author: Milan Crha <mcrha redhat com>
Date:   Mon Nov 23 20:31:45 2009 +0100

    Bug #602719 - Crash in ep_set_proxy with no proxy user or password

 libedataserver/e-proxy.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/libedataserver/e-proxy.c b/libedataserver/e-proxy.c
index 02cc36f..aef6203 100644
--- a/libedataserver/e-proxy.c
+++ b/libedataserver/e-proxy.c
@@ -638,14 +638,19 @@ ep_set_proxy (GConfClient *client,
 	}
 
 	if (gconf_client_get_bool (client, RIGHT_KEY (HTTP_USE_AUTH), NULL)) {
-		gchar *proxy_user, *proxy_pw, *tmp;
+		gchar *proxy_user, *proxy_pw, *tmp = NULL;
 
 		proxy_user = gconf_client_get_string (client, RIGHT_KEY (HTTP_AUTH_USER), NULL);
 		proxy_pw = gconf_client_get_string (client, RIGHT_KEY (HTTP_AUTH_PWD), NULL);
 
-		tmp = uri_http;
-
-		uri_http = g_strdup_printf ("http://%s:%s %s", proxy_user, proxy_pw, tmp + strlen ("http://";));
+		if (proxy_user && *proxy_user && proxy_pw && *proxy_pw) {
+			tmp = uri_http;
+			uri_http = g_strdup_printf ("http://%s:%s %s", proxy_user, proxy_pw, tmp + strlen ("http://";));
+		} else if (proxy_user && *proxy_user) {
+			/* proxy without password, just try it */
+			tmp = uri_http;
+			uri_http = g_strdup_printf ("http://%s %s", proxy_user, tmp + strlen ("http://";));
+		}
 
 		g_free (proxy_user);
 		g_free (proxy_pw);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]