From: TAKAHASHI Tamotsu Date: Fri, 29 Jul 2005 18:05:50 +0000 (+0000) Subject: "nospam foo" causes a segv if you have not set any "spam", because of X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=415faa961485c3080dcbe4f5d9a9013673810be7;p=neomutt "nospam foo" causes a segv if you have not set any "spam", because of a null pointer dereference. --- diff --git a/init.c b/init.c index 2e50d4380..6d9b0a9e9 100644 --- a/init.c +++ b/init.c @@ -448,6 +448,8 @@ static int remove_from_spam_list (SPAM_LIST **list, const char *pat) /* Being first is a special case. */ spam = *list; + if (!spam) + return 0; if (spam->rx && !mutt_strcmp(spam->rx->pattern, pat)) { *list = spam->next;