From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 995ED6DE0225 for ; Sat, 30 Jun 2018 08:31:26 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.407 X-Spam-Level: X-Spam-Status: No, score=0.407 tagged_above=-999 required=5 tests=[AWL=-0.407, DATE_IN_PAST_12_24=0.804, RCVD_IN_DNSWL_NONE=-0.0001, T_SPF_PERMERROR=0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UPoTELYRivyu for ; Sat, 30 Jun 2018 08:31:25 -0700 (PDT) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTPS id C65596DE0219 for ; Sat, 30 Jun 2018 08:31:25 -0700 (PDT) Received: from fifthhorseman.net (cpe-74-71-53-242.nyc.res.rr.com [74.71.53.242]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by che.mayfirst.org (Postfix) with ESMTPSA id 47040F9A0; Sat, 30 Jun 2018 11:31:23 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id DDAE4203E5; Fri, 29 Jun 2018 22:05:01 -0400 (EDT) From: Daniel Kahn Gillmor To: David Bremner , Notmuch Mail Subject: Re: [PATCH 09/20] util/crypto: add information about the payload part In-Reply-To: <87k1qnhdj1.fsf@tethera.net> References: <20180511055544.13676-1-dkg@fifthhorseman.net> <20180511055544.13676-10-dkg@fifthhorseman.net> <87k1qnhdj1.fsf@tethera.net> Date: Fri, 29 Jun 2018 22:05:01 -0400 Message-ID: <87efgpowqa.fsf@fifthhorseman.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.26 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: Sat, 30 Jun 2018 15:31:26 -0000 On Sun 2018-06-24 22:15:46 -0300, David Bremner wrote: > Daniel Kahn Gillmor writes: > >> @@ -270,7 +274,7 @@ _notmuch_message_crypto_potential_payload (_notmuch_message_crypto_t *msg_crypto >> if (parent && GMIME_IS_MULTIPART_ENCRYPTED (parent) && childnum == GMIME_MULTIPART_ENCRYPTED_VERSION) { >> const char *enc_type = g_mime_object_get_content_type_parameter (parent, "protocol"); >> GMimeContentType *ct = g_mime_object_get_content_type (payload); >> - if (ct) { >> + if (ct && enc_type) { >> const char *part_type = g_mime_content_type_get_mime_type (ct); >> if (part_type && strcmp (part_type, enc_type) == 0) >> return NOTMUCH_STATUS_SUCCESS; > > I couldn't really understand why enc_type was defined earlier than it > was used here. Is this a bug fix? whoops, you're right. I've moved this particular edit to an earlier patch in the series. good catch, thanks! --dkg