]> git.notmuchmail.org Git - notmuch/commitdiff
Avoid segfault on message with no subject.
authorCarl Worth <cworth@cworth.org>
Thu, 15 Oct 2009 00:24:28 +0000 (17:24 -0700)
committerCarl Worth <cworth@cworth.org>
Thu, 15 Oct 2009 00:24:28 +0000 (17:24 -0700)
It's fun how turning a program loose on 500,000 messages will find
lots of littel corner cases.

notmuch-index-message.cc

index 60370b62b99621f6d8ec1eea491d0b5b96c003ad..5c73825ba2f48e3d7964994d497e104c1a6464a0 100644 (file)
@@ -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++;