aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2009-10-13 21:13:23 -0700
committerCarl Worth <cworth@cworth.org>2009-10-13 21:15:12 -0700
commitc0da89a8e02190f172e6f53073827bbdf91d60eb (patch)
treefc7c68e8ca85774d6ddf0826cac82ca8a8384eb6
parent3922bb4cfda9d7e778a6cbf2bc8dee8ce2f9e140 (diff)
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.
-rw-r--r--notmuch-index-message.cc3
1 files changed, 3 insertions, 0 deletions
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++;