Re: [bug] possible condition depending on uninitialized value in _notmuch_message_sync

Subject: Re: [bug] possible condition depending on uninitialized value in _notmuch_message_sync

Date: Mon, 16 May 2022 09:01:25 -0300

To: Eliza Velasquez, notmuch@notmuchmail.org

Cc:

From: David Bremner


Eliza Velasquez <eliza@eliza.sh> writes:


> It becomes very clear why this error only happens when removing a
> non-existent tag if you look at at message.cc:1570...
>
> --8<---------------cut here---------------start------------->8---
>     try {
> 	message->doc.remove_term (term);
> 	message->modified = true;
>     } catch (const Xapian::InvalidArgumentError) {
> 	/* We'll let the philosophers try to wrestle with the
> 	 * question of whether failing to remove that which was not
> 	 * there in the first place is failure. For us, we'll silently
> 	 * consider it all good. */
>     }
> --8<---------------cut here---------------end--------------->8---

OK, I see why that assignment gets skipped. I think that's not the
actual bug, but rather message->modified should be initialized in
_notmuch_message_create_for_document. I'll have a closer look later
today

d
.
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: