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

Re: mutt/2841: seg fault when selecting folder "=."



The following reply was made to PR mutt/2841; it has been noted by GNATS.

From: TAKAHASHI Tamotsu <ttakah@xxxxxxxxxxxxxxxxx>
To: bug-any@xxxxxxxxxxxxx
Cc: 
Subject: Re: mutt/2841: seg fault when selecting folder "=."
Date: Tue, 13 Mar 2007 00:38:53 +0900

 * Mon Mar 12 2007 os@xxxxxxxxx <os@xxxxxxxxx>
 > >Number:         2841
 > >Notify-List:    
 > >Category:       mutt
 > >Synopsis:       seg fault when selecting folder "=."
 
 > >Description:
 > Installed and configured mutt for use with imap server, selecting folder 
 > '=.' results in seg fault
 > >How-To-Repeat:
 > run mutt, type "c=.\n"
 
 The log tells that idata->mailbox was NULL.
 
 Well, imap_fix_path can return "",
 and safe_strdup("") returns NULL.
 
 diff -r 8a640badfb60 imap/util.c
 --- a/imap/util.c      Sun Mar 11 11:54:14 2007 +0100
 +++ b/imap/util.c      Tue Mar 13 00:26:12 2007 +0900
 @@ -317,7 +317,10 @@ char *imap_fix_path (IMAP_DATA *idata, c
    }
    if (x && path[--x] != idata->delim)
      x++;
 -  path[x] = '\0';
 +  if (x)
 +    path[x] = '\0';
 +  else
 +    strfcpy (path, "INBOX", plen);
    return path;
  }
  
 
 -- 
 tamo