From c0da89a8e02190f172e6f53073827bbdf91d60eb Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Tue, 13 Oct 2009 21:13:23 -0700 Subject: [PATCH] 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. --- notmuch-index-message.cc | 3 +++ 1 file changed, 3 insertions(+) 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++;