From: Carl Worth Date: Thu, 15 Oct 2009 00:24:28 +0000 (-0700) Subject: Avoid segfault on message with no subject. X-Git-Tag: 0.1~855 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=914df660c423c078df20390a4b647edbe8fb712a 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. --- diff --git a/notmuch-index-message.cc b/notmuch-index-message.cc index 60370b62..5c73825b 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++;