[PATCH 4/7] util/crypto: _n_m_crypto_potential_payload returns whether part is the payload

David Bremner david at tethera.net
Thu Aug 1 04:32:56 PDT 2019


Daniel Kahn Gillmor <dkg at fifthhorseman.net> 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.


More information about the notmuch mailing list