aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/itip-formatter/itip-formatter.c
diff options
context:
space:
mode:
authorVivek Jain <jvivek@novell.com>2005-07-28 12:45:56 +0800
committerJain Vivek <jvivek@src.gnome.org>2005-07-28 12:45:56 +0800
commitc4cac6d1f2a79b8da49affe48da1494c0247fde3 (patch)
tree0ca869aecc3f38c962d0637abe58f1b47fbb4632 /plugins/itip-formatter/itip-formatter.c
parent72cfaedf4943f95029af307ba5d07b940b395ddb (diff)
downloadgsoc2013-evolution-c4cac6d1f2a79b8da49affe48da1494c0247fde3.tar.gz
gsoc2013-evolution-c4cac6d1f2a79b8da49affe48da1494c0247fde3.tar.zst
gsoc2013-evolution-c4cac6d1f2a79b8da49affe48da1494c0247fde3.zip
applied patch submitted by <tommi.komulainen@iki.fi> do not send "cid:" to
2005-07-27 Vivek Jain <jvivek@novell.com> * itip-formatter.c : (update_item) applied patch submitted by <tommi.komulainen@iki.fi> do not send "cid:" to get the part. check part for NULL before using it. (message_foreach_part): do nothing if part is NULL saves crash. **Fixes #272632 svn path=/trunk/; revision=29908
Diffstat (limited to 'plugins/itip-formatter/itip-formatter.c')
-rw-r--r--plugins/itip-formatter/itip-formatter.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c
index a090e33025..00c62bb325 100644
--- a/plugins/itip-formatter/itip-formatter.c
+++ b/plugins/itip-formatter/itip-formatter.c
@@ -666,6 +666,9 @@ message_foreach_part (CamelMimePart *part, GSList **part_list)
int parts, i;
int go = TRUE;
+ if (!part)
+ return;
+
*part_list = g_slist_append (*part_list, part);
containee = camel_medium_get_content_object (CAMEL_MEDIUM (part));
@@ -738,26 +741,29 @@ update_item (FormatItipPObject *pitip, ItipViewResponse response)
if (!g_ascii_strncasecmp (uri, "cid:...", 7)) {
message_foreach_part ((CamelMimePart *) msg, &parts);
-
+
for (m = parts; m; m = m->next) {
part = m->data;
-
+
/* Skip the actual message and the text/calendar part */
/* FIXME Do we need to skip anything else? */
if (part == (CamelMimePart *) msg || part == pitip->pobject.part)
continue;
-
+
new_uri = em_utils_temp_save_part (NULL, part);
g_message ("DEBUG: the uri obtained was %s\n", new_uri);
new_attachments = g_slist_append (new_attachments, new_uri);
}
-
+
g_slist_free (parts);
-
+
} else if (!g_ascii_strncasecmp (uri, "cid:", 4)) {
- part = camel_mime_message_get_part_by_content_id (msg, uri);
- new_uri = em_utils_temp_save_part (NULL, part);
- new_attachments = g_slist_append (new_attachments, new_uri);
+ part = camel_mime_message_get_part_by_content_id (msg, uri + 4);
+ if (part) {
+ new_uri = em_utils_temp_save_part (NULL, part);
+ new_attachments = g_slist_append (new_attachments, new_uri);
+ }
+
} else {
/* Preserve existing non-cid ones */
new_attachments = g_slist_append (new_attachments, g_strdup (uri));