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 004B16DE0173 for ; Sun, 24 Jun 2018 18:15:50 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.001 X-Spam-Level: X-Spam-Status: No, score=-0.001 tagged_above=-999 required=5 tests=[AWL=0.010, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-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 zoXZJ22N3JWS for ; Sun, 24 Jun 2018 18:15:48 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id B19F16DE004D for ; Sun, 24 Jun 2018 18:15:48 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1fXG6d-000826-NQ; Sun, 24 Jun 2018 21:15:47 -0400 Received: (nullmailer pid 13170 invoked by uid 1000); Mon, 25 Jun 2018 01:15:46 -0000 From: David Bremner To: Daniel Kahn Gillmor , Notmuch Mail Subject: Re: [PATCH 09/20] util/crypto: add information about the payload part In-Reply-To: <20180511055544.13676-10-dkg@fifthhorseman.net> References: <20180511055544.13676-1-dkg@fifthhorseman.net> <20180511055544.13676-10-dkg@fifthhorseman.net> Date: Sun, 24 Jun 2018 22:15:46 -0300 Message-ID: <87k1qnhdj1.fsf@tethera.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: Mon, 25 Jun 2018 01:15:50 -0000 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? d