diff options
author | Milan Crha <mcrha@src.gnome.org> | 2007-08-16 18:51:06 +0800 |
---|---|---|
committer | Milan Crha <mcrha@src.gnome.org> | 2007-08-16 18:51:06 +0800 |
commit | ca5d6d6a338fbe5d8e6b24b85f681b9df07ce392 (patch) | |
tree | 45fb3d086d27a695be5eff6ae9f7a8d47d23fd7b /mail | |
parent | 6ee27498e11e532a971cbb10659d754a7c2a577d (diff) | |
download | gsoc2013-evolution-ca5d6d6a338fbe5d8e6b24b85f681b9df07ce392.tar.gz gsoc2013-evolution-ca5d6d6a338fbe5d8e6b24b85f681b9df07ce392.tar.zst gsoc2013-evolution-ca5d6d6a338fbe5d8e6b24b85f681b9df07ce392.zip |
2007-08-16 mcrha Part of fix for bug #350539
svn path=/trunk/; revision=34017
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 11 | ||||
-rw-r--r-- | mail/em-format-html.c | 11 | ||||
-rw-r--r-- | mail/em-format-quote.c | 8 | ||||
-rw-r--r-- | mail/em-format.c | 11 | ||||
-rw-r--r-- | mail/em-popup.c | 5 |
5 files changed, 43 insertions, 3 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index ffdd76426a..19e5e6de00 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,14 @@ +2007-08-16 Milan Crha <mcrha@redhat.com> + + ** Part of fix for bug #350539 + + * em-format-quote.c: (emfq_format_headers), (emfq_text_plain): + * em-format.c: (emf_multipart_alternative), (emf_inlinepgp_signed): + * em-popup.c: (emp_part_popup_set_background): + * em-format-html.c: (efh_text_plain), (efh_message_external), + (efh_format_headers): + Ensures non-NULL part. + 2007-08-16 Srinivasa Ragavan <sragavan@novell.com> ** Fix for bug #467198 diff --git a/mail/em-format-html.c b/mail/em-format-html.c index 2fbe9932c2..3ff8358853 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -775,6 +775,9 @@ efh_text_plain(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFo for (i=0;i<count;i++) { CamelMimePart *newpart = camel_multipart_get_part(mp, i); + if (!newpart) + continue; + type = camel_mime_part_get_content_type(newpart); if (camel_content_type_is (type, "text", "*") && !camel_content_type_is(type, "text", "calendar")) { camel_stream_printf (stream, @@ -899,6 +902,11 @@ efh_message_external(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part const char *access_type; char *url = NULL, *desc = NULL; + if (!part) { + camel_stream_printf(stream, _("Unknown external-body part.")); + return; + } + /* needs to be cleaner */ type = camel_mime_part_get_content_type(part); access_type = camel_content_type_param (type, "access-type"); @@ -1779,6 +1787,9 @@ efh_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMedium *part) char *header_sender = NULL, *header_from = NULL, *name; gboolean mail_from_delegate = FALSE; + if (!part) + return; + ct = camel_mime_part_get_content_type((CamelMimePart *)part); charset = camel_content_type_param (ct, "charset"); charset = e_iconv_charset_name(charset); diff --git a/mail/em-format-quote.c b/mail/em-format-quote.c index 647a7783a5..1b17e004aa 100644 --- a/mail/em-format-quote.c +++ b/mail/em-format-quote.c @@ -358,6 +358,9 @@ emfq_format_headers (EMFormatQuote *emfq, CamelStream *stream, CamelMedium *part const char *charset; EMFormatHeader *h; + if (!part) + return; + ct = camel_mime_part_get_content_type ((CamelMimePart *) part); charset = camel_content_type_param (ct, "charset"); charset = e_iconv_charset_name (charset); @@ -457,7 +460,10 @@ emfq_text_plain(EMFormatQuote *emfq, CamelStream *stream, CamelMimePart *part, E CamelContentType *type; const char *format; guint32 rgb = 0x737373, flags; - + + if (!part) + return; + flags = emfq->text_html_flags; /* Check for RFC 2646 flowed text. */ diff --git a/mail/em-format.c b/mail/em-format.c index 40e2661706..7584f3301f 100644 --- a/mail/em-format.c +++ b/mail/em-format.c @@ -1243,6 +1243,10 @@ emf_multipart_alternative(EMFormat *emf, CamelStream *stream, CamelMimePart *par /* is it correct to use the passed in *part here? */ part = camel_multipart_get_part(mp, i); + + if (!part) + continue; + type = camel_mime_part_get_content_type (part); mime_type = camel_content_type_simple (type); @@ -1533,7 +1537,12 @@ emf_inlinepgp_signed(EMFormat *emf, CamelStream *stream, CamelMimePart *ipart, E CamelStream *ostream; CamelException *ex; char *type; - + + if (!ipart) { + em_format_format_error(emf, stream, _("Unknown error verifying signature")); + return; + } + ex = camel_exception_new(); cipher = camel_gpg_context_new(emf->session); /* Verify the signature of the message */ diff --git a/mail/em-popup.c b/mail/em-popup.c index f6f7372c40..bde562c939 100644 --- a/mail/em-popup.c +++ b/mail/em-popup.c @@ -435,7 +435,10 @@ emp_part_popup_set_background(EPopup *ep, EPopupItem *item, void *data) part = ((EAttachment *) ((EMPopupTargetAttachments *) t)->attachments->data)->body; else part = ((EMPopupTargetPart *) t)->part; - + + if (!part) + return; + filename = g_strdup(camel_mime_part_get_filename(part)); /* if filename is blank, create a default filename based on MIME type */ |