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-Tag: mutt-1-5-10-rel~108 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=49b346f8fede1cb13877314603dcd98cac59bba8;p=mutt "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 2e50d438..6d9b0a9e 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;