[evolution/gnome-3-6] Bug 694159 - Malformed content-type header causes infinite recursion



commit 881533927325432a0bab7eabea3a1d4008b5bcff
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sun Feb 24 21:46:36 2013 -0500

    Bug 694159 - Malformed content-type header causes infinite recursion

 em-format/e-mail-formatter-attachment.c |   22 ++++++++++++++++------
 1 files changed, 16 insertions(+), 6 deletions(-)
---
diff --git a/em-format/e-mail-formatter-attachment.c b/em-format/e-mail-formatter-attachment.c
index ffe1634..8e188c1 100644
--- a/em-format/e-mail-formatter-attachment.c
+++ b/em-format/e-mail-formatter-attachment.c
@@ -267,17 +267,27 @@ emfe_attachment_format (EMailFormatterExtension *extension,
                content_stream = camel_stream_mem_new ();
                ok = FALSE;
                if (empa->attachment_view_part_id != NULL) {
-
+                       EMailPart *attachment_view_part = NULL;
                        GSList *att_parts;
 
                        att_parts = e_mail_part_list_get_iter (
-                                               context->parts,
-                                               empa->attachment_view_part_id);
+                               context->parts,
+                               empa->attachment_view_part_id);
+
+                       if (att_parts != NULL && att_parts->data != NULL) {
+                               attachment_view_part = att_parts->data;
+
+                               /* Avoid recursion. */
+                               if (attachment_view_part == part)
+                                       attachment_view_part = NULL;
+                       }
 
-                       if (att_parts && att_parts->data) {
+                       if (attachment_view_part != NULL) {
                                ok = e_mail_formatter_format_as (
-                                       formatter, context, att_parts->data,
-                                       content_stream, NULL, cancellable);
+                                       formatter, context,
+                                       attachment_view_part,
+                                       content_stream, NULL,
+                                       cancellable);
                        }
 
                } else {


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