]> granicus.if.org Git - neomutt/commitdiff
"nospam foo" causes a segv if you have not set any "spam", because of
authorTAKAHASHI Tamotsu <ttakah@lapis.plala.or.jp>
Fri, 29 Jul 2005 18:05:50 +0000 (18:05 +0000)
committerTAKAHASHI Tamotsu <ttakah@lapis.plala.or.jp>
Fri, 29 Jul 2005 18:05:50 +0000 (18:05 +0000)
a null pointer dereference.

init.c

diff --git a/init.c b/init.c
index 2e50d4380a2af02853c7279be61a67743d2e0cb6..6d9b0a9e97fba0b4e7fe0b48cb5ccff70f7a9d5f 100644 (file)
--- 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;