Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 56378431FD0 for ; Thu, 2 Jun 2011 09:39:10 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.921 X-Spam-Level: X-Spam-Status: No, score=-1.921 tagged_above=-999 required=5 tests=[NO_DNS_FOR_FROM=0.379, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VxuV2A-3o1Hb for ; Thu, 2 Jun 2011 09:39:09 -0700 (PDT) Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu [131.215.239.19]) by olra.theworths.org (Postfix) with ESMTP id D893C431FB6 for ; Thu, 2 Jun 2011 09:39:09 -0700 (PDT) Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1]) by earth-doxen-postvirus (Postfix) with ESMTP id 3FDE766E0374; Thu, 2 Jun 2011 09:39:08 -0700 (PDT) X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new Received: from servo.finestructure.net (cpe-98-149-172-122.socal.res.rr.com [98.149.172.122]) (Authenticated sender: jrollins) by earth-doxen-submit (Postfix) with ESMTP id 64E6666E001F; Thu, 2 Jun 2011 09:38:58 -0700 (PDT) Received: by servo.finestructure.net (Postfix, from userid 1000) id 21D91AD8; Thu, 2 Jun 2011 09:38:59 -0700 (PDT) From: Jameson Graef Rollins To: Notmuch Mail Subject: [PATCH] Do not attept to output part raw if part is not GMimePart. Date: Thu, 2 Jun 2011 09:38:55 -0700 Message-Id: <1307032735-27427-1-git-send-email-jrollins@finestructure.net> X-Mailer: git-send-email 1.7.4.4 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jun 2011 16:39:10 -0000 This was a minor oversite in checking of part type when outputing content raw. This was causing gmime was to throw an exception to stderr. Unfortunately the gmime exception was not being caught by notmuch, or the test suite. I'm not sure if notmuch should have done anything in this case, but certainly the test suite should be capable of detecting that something unexpected was output to stderr. --- notmuch-show.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/notmuch-show.c b/notmuch-show.c index 9267d02..3b4f775 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -646,14 +646,15 @@ format_part_content_raw (GMimeObject *part) { GMimeStream *stream_stdout; GMimeStream *stream_filter = NULL; - GMimeDataWrapper *wrapper; + GMimeDataWrapper *wrapper = NULL; stream_stdout = g_mime_stream_file_new (stdout); g_mime_stream_file_set_owner (GMIME_STREAM_FILE (stream_stdout), FALSE); stream_filter = g_mime_stream_filter_new (stream_stdout); - wrapper = g_mime_part_get_content_object (GMIME_PART (part)); + if (GMIME_IS_PART (part)) + wrapper = g_mime_part_get_content_object (GMIME_PART (part)); if (wrapper && stream_filter) g_mime_data_wrapper_write_to_stream (wrapper, stream_filter); -- 1.7.4.4