From 0995aedae9fd9ef1d6bc5472a14d3d32c13186a4 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Fri, 6 Jul 2001 20:28:39 +0000 Subject: Prevent infinite recursion when viewing attachments that we can't / 2001-07-06 Peter Williams * mail-format.c (format_mime_part): Prevent infinite recursion when viewing attachments that we can't / shouldn't display but are some form of plaintext. Cf bug #2234 svn path=/trunk/; revision=10857 --- mail/ChangeLog | 6 ++++++ mail/mail-format.c | 19 ++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index 973e9d85ea..3dc30678fb 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,9 @@ +2001-07-06 Peter Williams + + * mail-format.c (format_mime_part): Prevent infinite recursion when + viewing attachments that we can't / shouldn't display but are some + form of plaintext. Cf bug #2234 + 2001-07-06 Jeffrey Stedfast * folder-browser.c (folder_browser_copy): Freeze and Thaw the diff --git a/mail/mail-format.c b/mail/mail-format.c index dceee68a37..517d0b7595 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -590,11 +590,20 @@ format_mime_part (CamelMimePart *part, MailDisplay *md) if (!handler) { char *id_type; - id_type = mail_identify_mime_part (part, md); - if (id_type) { - g_free (mime_type); - mime_type = id_type; - handler = mail_lookup_handler (id_type); + /* Special case MIME types that we know that we can't + * display but are some kind of plain text to prevent + * evil infinite recursion. + */ + + if (!strcmp (mime_type, "application/mac-binhex40")) { + handler = NULL; + } else { + id_type = mail_identify_mime_part (part, md); + if (id_type) { + g_free (mime_type); + mime_type = id_type; + handler = mail_lookup_handler (id_type); + } } } -- cgit