From 914df660c423c078df20390a4b647edbe8fb712a Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Wed, 14 Oct 2009 17:24:28 -0700 Subject: [PATCH] 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. --- notmuch-index-message.cc | 3 +++ 1 file changed, 3 insertions(+) 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++; -- 2.43.0