summaryrefslogtreecommitdiff
path: root/notmuch-index-message.cc
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2009-10-14 17:24:28 -0700
committerCarl Worth <cworth@cworth.org>2009-10-14 17:24:28 -0700
commit914df660c423c078df20390a4b647edbe8fb712a (patch)
tree1e05c9a6bed2266047d13ffedf27551d36c35936 /notmuch-index-message.cc
parentd643f7d7762e358bf7c5611635a36d27e6db9afa (diff)
Avoid segfault on message with no subject.
It's fun how turning a program loose on 500,000 messages will find lots of littel corner cases.
Diffstat (limited to 'notmuch-index-message.cc')
-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 60370b6..5c73825 100644
--- a/notmuch-index-message.cc
+++ b/notmuch-index-message.cc
@@ -253,6 +253,9 @@ skip_re_in_subject (const char *subject)
{
const char *s = subject;
+ if (subject == NULL)
+ return NULL;
+
while (*s) {
while (*s && isspace (*s))
s++;