<<< Date Index >>>     <<< Thread Index >>>

Re: Mutt crashed in mutt_pattern_exec just after sending a message



The following patch should take care of this:

diff -u -r3.13 pattern.c
--- pattern.c   3 Feb 2005 17:01:43 -0000       3.13
+++ pattern.c   9 Feb 2005 09:04:32 -0000
@@ -1008,9 +1008,9 @@
       return (pat->not ^ match_adrlist (pat->rx, flags & M_MATCH_FULL_ADDRESS,
                                        pat->alladdr, 1, h->env->cc));
     case M_SUBJECT:
-      return (pat->not ^ (h->env->subject && regexec (pat->rx, 
h->env->subject, 0, NULL, 0) == 0));
+      return (pat->not ^ (h->env && h->env->subject && regexec (pat->rx, 
h->env->subject, 0, NULL, 0) == 0));
     case M_ID:
-      return (pat->not ^ (h->env->message_id && regexec (pat->rx, 
h->env->message_id, 0, NULL, 0) == 0));
+      return (pat->not ^ (h->env && h->env->message_id && regexec (pat->rx, 
h->env->message_id, 0, NULL, 0) == 0));
     case M_SCORE:
       return (pat->not ^ (h->score >= pat->min && (pat->max == M_MAXRANGE ||
                                                   h->score <= pat->max)));
@@ -1019,18 +1019,18 @@
     case M_REFERENCE:
       return (pat->not ^ match_reference (pat->rx, h->env->references));
     case M_ADDRESS:
-      return (pat->not ^ match_adrlist (pat->rx, flags & M_MATCH_FULL_ADDRESS,
+      return (pat->not ^ (h->env && match_adrlist (pat->rx, flags & 
M_MATCH_FULL_ADDRESS,
                                        pat->alladdr, 4, h->env->from,
-                                       h->env->sender, h->env->to, 
h->env->cc));
+                                       h->env->sender, h->env->to, 
h->env->cc)));
     case M_RECIPIENT:
-           return (pat->not ^ match_adrlist (pat->rx, flags & 
M_MATCH_FULL_ADDRESS,
-                                       pat->alladdr, 2, h->env->to, 
h->env->cc));
+           return (pat->not ^ (h->env && match_adrlist (pat->rx, flags & 
M_MATCH_FULL_ADDRESS,
+                                       pat->alladdr, 2, h->env->to, 
h->env->cc)));
     case M_LIST:
-      return (pat->not ^ mutt_is_list_recipient (pat->alladdr, h->env->to, 
h->env->cc));
+      return (pat->not ^ (h->env && mutt_is_list_recipient (pat->alladdr, 
h->env->to, h->env->cc)));
     case M_PERSONAL_RECIP:
-      return (pat->not ^ match_user (pat->alladdr, h->env->to, h->env->cc));
+      return (pat->not ^ (h->env && match_user (pat->alladdr, h->env->to, 
h->env->cc)));
     case M_PERSONAL_FROM:
-      return (pat->not ^ match_user (pat->alladdr, h->env->from, NULL));
+      return (pat->not ^ (h->env && match_user (pat->alladdr, h->env->from, 
NULL)));
     case M_COLLAPSED:
       return (pat->not ^ (h->collapsed && h->num_hidden > 1));
    case M_CRYPT_SIGN:



On 2005-02-09 02:48:20 +0100, Vincent Lefevre wrote:
> From: Vincent Lefevre <vincent@xxxxxxxxxx>
> To: mutt-dev@xxxxxxxx
> Date: Wed, 9 Feb 2005 02:48:20 +0100
> Subject: Re: Mutt crashed in mutt_pattern_exec just after sending a message
> Mail-Followup-To: mutt-dev@xxxxxxxx
> X-Spam-Level: 
> 
> On 2005-02-08 19:07:35 +0100, Thomas Roessler wrote:
> > On 2005-02-08 14:31:46 +0100, Vincent Lefevre wrote:
> > 
> > > #0  0x0808decc in mutt_pattern_exec (pat=0x8201b00, flags=0, 
> > > ctx=0x820d228, 
> > >     h=0x837e040) at pattern.c:1034
> > > 1034          return (pat->not ^ (h->env->message_id && regexec (pat->rx, 
> > > h->env->message_id, 0, NULL, 0) == 0));
> > > (gdb) backtrace
> > 
> > What are the values of h->env and h->env->message_id?
> 
> (gdb) print h->env
> $1 = (ENVELOPE *) 0x0
> 
> -- 
> Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
> 100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
> Work: CR INRIA - computer arithmetic / SPACES project at LORIA
> 
> 

-- 
Thomas Roessler · Personal soap box at <http://log.does-not-exist.org/>.