Oswald Buddenhagen wrote:
> On Thu, Jun 18, 2015 at 01:19:33PM -0700, Kevin J. McCarthy wrote:
> > I'm attaching a patch that does this. 
> 
> > It keeps the NONULL check in imap_auth_sasl, because it still seems
> > possible this could be called without capstr being set.
> >
> this seems plain wrong. it would most probably indicate a bug in the
> code preceding it. the server SHOULD send an unsolicited CAPABILITY
> response when the connection is established, and failing that, the
> client is expected to issue a CAPABILITY command (iirc, it's not really
> required to do that, but the client cannot really act without it).

I'm really not that familiar with IMAP or the imap code in Mutt, however
it does look like that's what mutt is doing.  After opening the socket,
mutt runs imap_cmd_step() which should handle the server responses.

Then below, it double checks the buffer to see if a CAPABILITY header
was sent back, and if not, calls imap_check_capabilities().

However, currently Mutt will *always* run the authenticators, regardless
if the capability is sucessfully set, so the strstr could generate a
segfault.

Additionally, further down in imap_auth_sasl() there are a couple checks
for whether method is NULL, so the NONULL check is not inconsistent
inside the function.

-- 
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA
http://www.8t8.us/configs/gpg-key-transition-statement.txt

Attachment: signature.asc
Description: PGP signature

Reply via email to