unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
To: David Bremner <david@tethera.net>,
	Notmuch Mail <notmuch@notmuchmail.org>
Subject: Re: [PATCH 5/7] util/repair: add _notmuch_repair_crypto_payload_skip_legacy_display
Date: Tue, 06 Aug 2019 09:08:22 -0400	[thread overview]
Message-ID: <87mugmphkp.fsf@fifthhorseman.net> (raw)
In-Reply-To: <87blx6wa99.fsf@tethera.net>

[-- Attachment #1: Type: text/plain, Size: 1396 bytes --]

Hi Bremner--

thanks for the review!

On Sat 2019-08-03 12:15:30 -0300, David Bremner wrote:
> Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:
>
>> +	ret = true;
>> +	for (int i = 0; i < g_mime_header_list_get_count (legacy_display_headers); i++) {
>> +	    GMimeHeader *dh = g_mime_header_list_get_header_at (legacy_display_headers, i);
>> +	    if (dh == NULL) {
>> +		ret = false;
>> +		break;
>> +	    }
>
> I can live with the use of break if you think it's superior, but I think
> the idiom of "goto DONE" is more common in the notmuch codebase. I
> personally always have think about the semantics of "break" and
> "continue" in C pretty carefully.

i thought i was the only one who got confused between "break" and
"continue"!  I will convert to goto DONE, i agree it's more readable.

>> +	    if (strcmp (g_mime_header_get_value (dh), g_mime_header_get_value (ph))) {
>> +		ret = false;
>> +		break;
>> +	    }
>
> It's not really clear to me what kind of "invalid" causes
> g_mime_header_get_value to return NULL. Maybe this strcmp should be
> guarded against that?

i think it's impossible in the current implementation for this to go
wrong, since we've already got a GMimeHeader object from an existing
block of headers, but i'll add some protection just in case GMime
changes its implementation or some fuzzer constructs a truly devious
not-quite-RFC-822 input.

         --dkg

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

  reply	other threads:[~2019-08-06 13:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-25  1:41 v3 of legacy-display cleanup Daniel Kahn Gillmor
2019-06-25  1:41 ` [PATCH 1/7] mime-node: split out _mime_node_set_up_part Daniel Kahn Gillmor
2019-06-25  2:43   ` William Casarin
2019-06-25 17:59     ` Daniel Kahn Gillmor
2019-06-25  1:41 ` [PATCH 2/7] repair: set up codebase for repair functionality Daniel Kahn Gillmor
2019-06-25  1:41 ` [PATCH 3/7] test: avoid showing legacy-display parts Daniel Kahn Gillmor
2019-06-25  1:41 ` [PATCH 4/7] util/crypto: _n_m_crypto_potential_payload returns whether part is the payload Daniel Kahn Gillmor
2019-07-31 11:57   ` David Bremner
2019-08-01  3:15     ` Daniel Kahn Gillmor
2019-08-01  3:29       ` Daniel Kahn Gillmor
2019-08-01 11:32         ` David Bremner
2019-08-01 14:10           ` Daniel Kahn Gillmor
2019-08-01 11:33       ` David Bremner
2019-06-25  1:41 ` [PATCH 5/7] util/repair: add _notmuch_repair_crypto_payload_skip_legacy_display Daniel Kahn Gillmor
2019-06-25  3:02   ` William Casarin
2019-06-25 18:10     ` Daniel Kahn Gillmor
2019-08-03 15:15   ` David Bremner
2019-08-06 13:08     ` Daniel Kahn Gillmor [this message]
2019-06-25  1:41 ` [PATCH 6/7] cli/{show,reply}: skip over legacy-display parts Daniel Kahn Gillmor
2019-06-25  1:41 ` [PATCH 7/7] index: avoid indexing " Daniel Kahn Gillmor
2019-06-25  3:06 ` v3 of legacy-display cleanup William Casarin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mugmphkp.fsf@fifthhorseman.net \
    --to=dkg@fifthhorseman.net \
    --cc=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).