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 CC2EF6DE10E8 for ; Thu, 1 Aug 2019 04:33:04 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.051 X-Spam-Level: X-Spam-Status: No, score=-0.051 tagged_above=-999 required=5 tests=[AWL=-0.050, SPF_PASS=-0.001] 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 r3s1jqYyRWZW for ; Thu, 1 Aug 2019 04:33:03 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id A96A56DE10C9 for ; Thu, 1 Aug 2019 04:33:03 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1ht9KO-0001cY-CY; Thu, 01 Aug 2019 07:33:00 -0400 Received: (nullmailer pid 16746 invoked by uid 1000); Thu, 01 Aug 2019 11:32:56 -0000 From: David Bremner To: Daniel Kahn Gillmor , Notmuch Mail Subject: Re: [PATCH 4/7] util/crypto: _n_m_crypto_potential_payload returns whether part is the payload In-Reply-To: <87v9vhr2b2.fsf@fifthhorseman.net> References: <20190625014107.12452-1-dkg@fifthhorseman.net> <20190625014107.12452-5-dkg@fifthhorseman.net> <878ssetnzv.fsf@tethera.net> <87y30dr2xg.fsf@fifthhorseman.net> <87v9vhr2b2.fsf@fifthhorseman.net> Date: Thu, 01 Aug 2019 08:32:56 -0300 Message-ID: <87v9vhruhj.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 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, 01 Aug 2019 11:33:04 -0000 Daniel Kahn Gillmor writes: > On Wed 2019-07-31 23:15:55 -0400, Daniel Kahn Gillmor wrote: >> On Wed 2019-07-31 08:57:56 -0300, David Bremner wrote: >>> what about leaving an assert or call to INTERNAL_ERROR here? I'm a bit >>> concerned this change is making the code less robust. I guess we'll see >>> a segfault, if either is NULL, but that seems bit icky to rely on. >> >> Sure, INTERNAL_ERROR makes sense, i think. > > hm, INTERNAL_ERROR is only a valid symbol within libnotmuch, and > util/crypto.o is *not* within libnotmuch. So i think i'll use assert, > by analogy with hex_encode() in util/hex_encode.c. let me know if you > think that's a bad idea for some reason. > assert is OK, but INTERNAL_ERROR is definded in util/error_util.c, so including that header is another sensible option.