From: Carl Worth Date: Wed, 14 Oct 2009 04:13:23 +0000 (-0700) Subject: notmuch-index-message: Avoid crashing when a message has no references. X-Git-Tag: 0.1~878 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=c0da89a8e02190f172e6f53073827bbdf91d60eb;ds=sidebyside notmuch-index-message: Avoid crashing when a message has no references. It's obviously an innocent-enough message, and the right thing is so easy to do. --- diff --git a/notmuch-index-message.cc b/notmuch-index-message.cc index 51c9f049..a0faf442 100644 --- a/notmuch-index-message.cc +++ b/notmuch-index-message.cc @@ -215,6 +215,9 @@ add_terms_references (Xapian::Document doc, refs = g_mime_object_get_header (GMIME_OBJECT (message), "references"); + if (refs == NULL) + return; + while (*refs) { while (*refs && isspace (*refs)) refs++;