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

[PATCH] STARTTLS error recovery bugfix



If STARTTLS fails to complete the SSL handshake, the error is not
propagated and mutt will attempt to log in anyway, probably causing an
infinite block on read. The attached patch closes the socket in this
case, and propagates the error properly.
Index: imap.c
===================================================================
RCS file: /home/roessler/cvs/mutt/imap/imap.c,v
retrieving revision 3.12
diff -u -p -r3.12 imap.c
--- imap.c      4 Jan 2004 09:45:05 -0000       3.12
+++ imap.c      25 Jul 2004 18:24:49 -0000
@@ -426,7 +426,7 @@ int imap_open_connection (IMAP_DATA* ida
          {
            mutt_error (_("Could not negotiate TLS connection"));
            mutt_sleep (1);
-           goto bail;
+           goto err_close_conn;
          }
          else
          {
@@ -456,6 +456,7 @@ int imap_open_connection (IMAP_DATA* ida
 
  err_close_conn:
   mutt_socket_close (idata->conn);
+  idata->state = IMAP_DISCONNECTED;
  bail:
   FREE (&idata->capstr);
   return -1;

Attachment: pgpdzXzElswMJ.pgp
Description: PGP signature