From b9d270f3a89066fc537e1ee0afa4a6cbe63b846b Mon Sep 17 00:00:00 2001 From: vitaly Date: Tue, 26 May 2009 14:59:24 +0000 Subject: [PATCH] Fix Emacs crash in mime-view Emacs crashes with segmentation fault when mime-view tries to display malformed base64 attach like this one: Content-Type: text/plain Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="dashik.V4S" Attachment is a binary file, but content-type is set to text/plain. Function decode-coding-string crashes in such sutuation when encoding set to x-ctext. Default encoding in APEL is x-unknown, but Wl reassigns it to x-ctext to make summary buffer display non-ascii characters in message correctly. It is not necessary to do for invalid attachments, so put default-mime-charset back to x-unknown while displaying entities. --- elmo/elmo-mime.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/elmo/elmo-mime.el b/elmo/elmo-mime.el index 5ccc1d2..c9c1028 100644 --- a/elmo/elmo-mime.el +++ b/elmo/elmo-mime.el @@ -80,7 +80,8 @@ use for keymap of representation buffer.") &optional original-major-mode keymap) - (let ((elmo-message-displaying t)) + (let ((elmo-message-displaying t) + (default-mime-charset 'x-unknown)) (mime-display-message entity preview-buffer nil -- 1.7.10.4