aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-01-08 01:33:59 +0800
committerMilan Crha <mcrha@redhat.com>2010-01-08 01:33:59 +0800
commitd52040f42b0964b6f56f639bc6bc99c6f1a9906f (patch)
treeb16f1f3cef02b1b70d05f6f4a97c4733f07446ae
parent5accac136eb35405cbb8069e0f12191391c58a1a (diff)
downloadgsoc2013-evolution-d52040f42b0964b6f56f639bc6bc99c6f1a9906f.tar
gsoc2013-evolution-d52040f42b0964b6f56f639bc6bc99c6f1a9906f.tar.gz
gsoc2013-evolution-d52040f42b0964b6f56f639bc6bc99c6f1a9906f.tar.bz2
gsoc2013-evolution-d52040f42b0964b6f56f639bc6bc99c6f1a9906f.tar.lz
gsoc2013-evolution-d52040f42b0964b6f56f639bc6bc99c6f1a9906f.tar.xz
gsoc2013-evolution-d52040f42b0964b6f56f639bc6bc99c6f1a9906f.tar.zst
gsoc2013-evolution-d52040f42b0964b6f56f639bc6bc99c6f1a9906f.zip
Bug #606316 - Mail with an attachment in a Junk folder crashes Evo
-rw-r--r--mail/em-format-html-display.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c
index 9228aec472..ccbf531e52 100644
--- a/mail/em-format-html-display.c
+++ b/mail/em-format-html-display.c
@@ -801,20 +801,23 @@ efhd_attachment_button(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObje
gpointer parent;
EMFormat *emf = (EMFormat *) efh;
CamelMessageInfo *mi = NULL;
- CamelMessageContentInfo *ci = NULL;
- GFileInfo *fileinfo;
- guint32 size;
+ guint32 size = 0;
/* FIXME: handle default shown case */
d(printf("adding attachment button/content\n"));
mi = camel_folder_summary_uid (emf->folder->summary, emf->uid);
- ci = camel_folder_summary_guess_content_info (mi, ((CamelDataWrapper *)pobject->part)->mime_type);
- if (ci) {
- size = ci->size;
- /* what if its not encoded in base64 ? is it a case to consider? */
- if (ci->encoding && !g_ascii_strcasecmp (ci->encoding, "base64"))
- size = size/1.37;
+ if (mi) {
+ const CamelMessageContentInfo *ci;
+
+ ci = camel_folder_summary_guess_content_info (mi, camel_mime_part_get_content_type (pobject->part));
+ if (ci) {
+ size = ci->size;
+ /* what if its not encoded in base64 ? is it a case to consider? */
+ if (ci->encoding && !g_ascii_strcasecmp (ci->encoding, "base64"))
+ size = size/1.37;
+ }
+ camel_message_info_free (mi);
}
info = (struct _attach_puri *)em_format_find_puri((EMFormat *)efh, pobject->classid);
@@ -843,6 +846,8 @@ efhd_attachment_button(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObje
info->attachment, (GAsyncReadyCallback)
e_attachment_load_handle_error, parent);
if (size != 0) {
+ GFileInfo *fileinfo;
+
fileinfo = e_attachment_get_file_info (info->attachment);
g_file_info_set_size (fileinfo, size);
e_attachment_set_file_info (info->attachment, fileinfo);