Re: [PATCH 09/20] util/crypto: add information about the payload part

2018-06-30 Thread Daniel Kahn Gillmor
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
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 09/20] util/crypto: add information about the payload part

2018-06-24 Thread David Bremner
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
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch