[前][次][番号順一覧][スレッド一覧]

sylpheed-jp:2792

From: WAKAI Kazunao <silver@xxxxxxxxxx>
Date: Tue, 18 Jan 2005 16:30:35 +0900
Subject: [sylpheed-jp:02792] Crash when when ~/Mail/inbox/0 exists

若居です。

MH メールボックスに 0 というファイルがあると、メールの内容を見ようとし
た時にクラッシュします。

Sylpheed 1.0.0 + Debian woody (+some sid) で再現しました。

messageview.c:432 では、messageview->msginfo と msginfo を比較して、相
違があった場合に再度 procmsg_msginfo_get_full_info() によりメッセージ
のメタ情報を読みこもうとします。

messageview.c:
432	if (messageview->msginfo != msginfo) {
433		procmsg_msginfo_free(messageview->msginfo);
434		messageview->msginfo = procmsg_msginfo_get_full_info(msginfo);
435	}
436	headerview_show(messageview->headerview, messageview->msginfo);

この時、該当するファイル(~/Mail/inbox/0) を読んだ結果として 
messageview と msginfo は次のようになっています。

(gdb) p messageview
$4 = {vbox = 0x81f7a58, type = MVIEW_TEXT, new_window = 0, window = 0x0, 
  window_vbox = 0x0, body_vbox = 0x0, headerview = 0x81e7440, 
  textview = 0x81e7708, mimeview = 0x81f3d28, statusbar = 0x81d3ac0, 
  statusbar_cid = 4, mainwin = 0x819ea80, msginfo = 0x0, forced_charset = 0x0, 
  visible = 1}
(gdb) p msginfo
$5 = (MsgInfo *) 0x81defd0

そのため、procmsg_msginfo_free() で現在の値を解放後、
procmsg_msginfo_get_full_info() で新しく messageview->msginfo を読みな
おそうとします。

しかしながら、msginfo が NULL(0x00) であるため、
procmsg_msginfo_get_full_info() は単なる NULL を返します。

そのため、headerview.c:176 の headerview_show() において、
msginfo->from (0x20) のメモリを参照しようとし、結果 Segmentation Fault 
となります。

headerview.c:
176	if (msginfo->from) {
177		Xstrdup_a(str, msginfo->from, return);
178		conv_unreadable_locale(str);
179	} else

途中で assert には引っかかっているんですが、その後も延々処理を継続して
いるのが原因ですね。

--- 
"ABH RoR RAGH A HoRA RoRITe ELASETA"
WAKAI "SilverRain" Kazunao <silver@xxxxxxxxxx>



[前][次][番号順一覧][スレッド一覧]