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

Re: bug#1759: mutt-1.5.5.1i: Lines header can segfault mutt



tags 1759 patch
thanks


Hello Aron, and thanks for your Mutt support.

    The report seems to not have reached mutt-dev list, found it only on
the BTS at <URL:http://bugs.guug.de/db/17/1759.html>.

 On Wednesday, January 14, 2004 at 4:49:05 PM -0500, Aron Griffis wrote:

> Switch on "edit_headers" in your muttrc, write an email containing a
> Lines header, for example
>| From: me@xxxxxxxxxxx
>| To: you@xxxxxxxxxxxxx
>| Lines: 10
> Save, exit the editor and see the segfault:
>| "/tmp/mutt-agriffis-23229-1" 4L, 41C written
>| Segmentation fault

    Confirmed. On February 13 2002 in early 1.5 a change was made to
parse.c:mutt_parse_rfc822_line() to deal with wrong negative values in
Lines header. This change lack a pair of curly brackets around a
conditional block, making Mutt shamelessly use a NULL pointer. The
attached patch fixes this.


Bye!    Alain.
-- 
Give your computer's unused idle processor cycles to a scientific goal:
The Folding@home project at <URL:http://folding.stanford.edu/>.
Adds 2 lacking braces. AB.
Fixes bug #1759: Lines header in $edit_headers segfaults.

diff -prud mutt-1.5.6.orig/parse.c mutt-1.5.6/parse.c
--- mutt-1.5.6.orig/parse.c     Wed Nov  5 10:41:33 2003
+++ mutt-1.5.6/parse.c  Wed Jun  2 17:06:55 2004
@@ -1053,14 +1053,16 @@ int mutt_parse_rfc822_line (ENVELOPE *e,
     if (!ascii_strcasecmp (line + 1, "ines"))
     {
       if (hdr)
+      {
        hdr->lines = atoi (p);
 
-      /* 
-       * HACK - mutt has, for a very short time, produced negative
-       * Lines header values.  Ignore them. 
-       */
-      if (hdr->lines < 0)
-       hdr->lines = 0;
+       /* 
+        * HACK - mutt has, for a very short time, produced negative
+        * Lines header values.  Ignore them. 
+        */
+       if (hdr->lines < 0)
+         hdr->lines = 0;
+      }
 
       matched = 1;
     }
--- PATCHES     Tue Nov  6 19:59:33 2001
+++ PATCHES     Tue Nov  6 19:59:42 2001
@@ -1,0 +1 @@
+patch-1.5.6.ab.bug_1759.1