summaryrefslogtreecommitdiff
path: root/mail/claws-mail-vcalendar/patches/patch-CVE-2012-5527_1
blob: e81bf349a0a55748c4072b50fb19717815ff6ba3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
$NetBSD: patch-CVE-2012-5527_1,v 1.1 2012/11/29 11:01:16 drochner Exp $

http://www.thewildbeast.co.uk/claws-mail/bugzilla/show_bug.cgi?id=2782

--- src/vcal_folder.c.orig	2011-11-16 05:41:53.000000000 +0000
+++ src/vcal_folder.c
@@ -1609,7 +1609,7 @@ void *url_read_thread(void *data)
 	return GINT_TO_POINTER(0);
 }
 
-gchar *vcal_curl_read(const char *url, gboolean verbose, 
+gchar *vcal_curl_read(const char *url, const gchar *label, gboolean verbose, 
 	void (*callback)(const gchar *url, gchar *data, gboolean verbose, gchar *error))
 {
 	gchar *result;
@@ -1618,25 +1618,19 @@ gchar *vcal_curl_read(const char *url, g
 	pthread_t pt;
 	pthread_attr_t pta;
 #endif
-	gchar *msg;
 	void *res;
 	gboolean killed;
 	gchar *error = NULL;
 	result = NULL;
 	td = g_new0(thread_data, 1);
-	msg = NULL;
 	res = NULL;
 	killed = FALSE;
-	
+
 	td->url  = url;
 	td->result  = NULL;
 	td->done = FALSE;
-	
-	msg = g_strdup_printf(_("Fetching '%s'..."), url);
-	
-	STATUSBAR_PUSH(mainwindow_get_mainwindow(), msg);
-	
-	g_free(msg);
+
+	STATUSBAR_PUSH(mainwindow_get_mainwindow(), label);
 
 #ifdef USE_PTHREAD
 	if (pthread_attr_init(&pta) != 0 ||
@@ -1868,7 +1862,8 @@ static void update_subscription_finish(c
 static void update_subscription(const gchar *uri, gboolean verbose)
 {
 	FolderItem *item = get_folder_item_for_uri(uri);
-	
+	gchar *label;
+
 	if (prefs_common_get_prefs()->work_offline) {
 		if (!verbose || 
 		!inc_offline_should_override(TRUE,
@@ -1882,7 +1877,11 @@ static void update_subscription(const gc
 			return;
 	}
 	main_window_cursor_wait(mainwindow_get_mainwindow());
-	vcal_curl_read(uri, verbose, update_subscription_finish);
+
+	label = g_strdup_printf(_("Fetching calendar for %s..."), 
+			item && item->name ? item->name : _("new subscription"));
+	vcal_curl_read(uri, label, verbose, update_subscription_finish);
+	g_free(label);
 }
 
 static void check_subs_cb(GtkAction *action, gpointer data)