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

imap/2175: IMAP header cache segfault



>Number:         2175
>Notify-List:    
>Category:       imap
>Synopsis:       IMAP header cache segfault
>Confidential:   no
>Severity:       normal
>Priority:       medium
>Responsible:    mutt-dev
>State:          open
>Keywords:       
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 01 19:55:32 +0100 2006
>Originator:     Stefan Farfeleder
>Release:        1.5.11
>Organization:
>Environment:
FreeBSD 7-current/i386
installed from the mail/mutt-devel port with WITH_MUTT_IMAP_HEADER_CACHE=yes
>Description:
I'm using mutt with an IMAP server and have enabled the IMAP header cache.  At 
times mutt segfaults when opening an already cached folder with a few thousand 
mails.  The variable header_cache points to a directory if that matters.

Mutt crashes because the variable 'h' on imap/command.c:485 is NULL which is 
dereference two lines below.
>How-To-Repeat:
>Fix:
An obvious thing to do would be to test if h != NULL before dereferencing it.  
But maybe the bug is elsewhere and idata->ctx->hdrs[i] should never be NULL.
>Add-To-Audit-Trail:

>Unformatted:
 ----gnatsweb-attachment----
 Content-Type: application/octet-stream; name="mutt-gdb-output"
 Content-Transfer-Encoding: base64
 Content-Disposition: attachment; filename="mutt-gdb-output"
 
 JCBnZGIgLi9tdXR0IG11dHQuY29yZQpHTlUgZ2RiIDYuMS4xIFtGcmVlQlNEXQpDb3B5cmlnaHQg
 MjAwNCBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb24sIEluYy4KR0RCIGlzIGZyZWUgc29mdHdhcmUs
 IGNvdmVyZWQgYnkgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlLCBhbmQgeW91IGFyZQp3
 ZWxjb21lIHRvIGNoYW5nZSBpdCBhbmQvb3IgZGlzdHJpYnV0ZSBjb3BpZXMgb2YgaXQgdW5kZXIg
 Y2VydGFpbiBjb25kaXRpb25zLgpUeXBlICJzaG93IGNvcHlpbmciIHRvIHNlZSB0aGUgY29uZGl0
 aW9ucy4KVGhlcmUgaXMgYWJzb2x1dGVseSB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