[evolution/webkit: 89/171] Prevent endless recursion when parsing SMIME-ecnrypted message fails



commit 8b2edb532d03e8e2597da2c01bdb228f396f5605
Author: Dan VrÃtil <dvratil redhat com>
Date:   Tue Dec 20 09:48:39 2011 +0100

    Prevent endless recursion when parsing SMIME-ecnrypted message fails

 em-format/em-format.c         |   10 ++++------
 mail/em-format-html-display.c |    2 +-
 2 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/em-format/em-format.c b/em-format/em-format.c
index 964fe90..9f5242e 100644
--- a/em-format/em-format.c
+++ b/em-format/em-format.c
@@ -226,8 +226,6 @@ emf_parse_application_xpkcs7mime (EMFormat *emf,
 			local_error->message ? local_error->message :
 			_("Could not parse S/MIME message: Unknown error"));
 		g_clear_error (&local_error);
-
-		em_format_parse_part_as (emf, part, part_id, info, NULL, cancellable);
 	} else {
 		EMFormatParserInfo encinfo = {
 				info->handler,
@@ -1946,10 +1944,10 @@ em_format_parse_part_as (EMFormat *emf,
 	const EMFormatHandler *handler;
         const CamelContentDisposition *disposition;
 	EMFormatParserInfo ninfo = {
-		0,
-		info ? info->validity_type : 0,
-		info ? info->validity : 0,
-                0,
+		.handler = 0,
+		.validity_type = info ? info->validity_type : 0,
+		.validity = info ? info->validity : 0,
+                .force_handler = 0
 	};
 
         /* Let everything that claims to be an attachment or inlined part to be parsed 
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c
index 3672674..b251aa6 100644
--- a/mail/em-format-html-display.c
+++ b/mail/em-format-html-display.c
@@ -492,7 +492,7 @@ efhd_parse_attachment (EMFormat *emf,
 
         /* Though it is an attachment, we still might be able to parse it and
          * so discover some parts that we might be event able to display. */
-        if (handler && handler->parse_func && 
+        if (handler && handler->parse_func && (handler->parse_func != efhd_parse_attachment) &&
             ((handler->flags & EM_FORMAT_HANDLER_COMPOUND_TYPE) ||
              (handler->flags & EM_FORMAT_HANDLER_INLINE_DISPOSITION))) {
                 EMFormatParserInfo attachment_info = { .handler = handler,



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