[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squirrelmail-cvs
Subject:    [SM-CVS] SF.net SVN: squirrelmail:[14569] trunk/imap_proxy
From:       pdontthink () users ! sourceforge ! net
Date:       2016-09-14 1:43:50
Message-ID: E1bjzEv-0001ua-20 () sfs-ml-1 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 14569
          http://sourceforge.net/p/squirrelmail/code/14569
Author:   pdontthink
Date:     2016-09-14 01:43:49 +0000 (Wed, 14 Sep 2016)
Log Message:
-----------
Fix anomalous crashes recycling used connections (thanks to Emmanuel Dreyfus)

Modified Paths:
--------------
    trunk/imap_proxy/ChangeLog
    trunk/imap_proxy/src/icc.c

Modified: trunk/imap_proxy/ChangeLog
===================================================================
--- trunk/imap_proxy/ChangeLog	2016-09-14 01:30:38 UTC (rev 14568)
+++ trunk/imap_proxy/ChangeLog	2016-09-14 01:43:49 UTC (rev 14569)
@@ -3,6 +3,8 @@
 	* Added support for accepting pre-auth ID commands (RFC 2971)
 	* Make EGD support conditional, provide compatibility with
 	  LibreSSL, other small fixes provided by the BSD team
+	* Fixed anomalous crashes recycling used connections (thanks
+	  to Emmanuel Dreyfus)
 
 2014-01-20  Paul Lesniewski <paul@squirrelmail.org>
 	* Added support for up to TLS v1.2 (thanks to Emmanuel Dreyfus)

Modified: trunk/imap_proxy/src/icc.c
===================================================================
--- trunk/imap_proxy/src/icc.c	2016-09-14 01:30:38 UTC (rev 14568)
+++ trunk/imap_proxy/src/icc.c	2016-09-14 01:43:49 UTC (rev 14569)
@@ -136,18 +136,25 @@
 		syslog(LOG_INFO, "Expiring server sd [%d]", HashEntry->server_conn->sd);
 		/* Logout of the IMAP server and close the server socket. */
 
-		IMAP_Write( HashEntry->server_conn, "VIC20 LOGOUT\r\n",
-			    strlen( "VIC20 LOGOUT\r\n" ) );
+		if (HashEntry->server_conn->sd != -1)
+		{
+		    IMAP_Write( HashEntry->server_conn, "VIC20 LOGOUT\r\n",
+		    	        strlen( "VIC20 LOGOUT\r\n" ) );
 
 #if HAVE_LIBSSL
-		if ( HashEntry->server_conn->tls )
+		    if ( HashEntry->server_conn->tls )
+		    {
+		        SSL_shutdown( HashEntry->server_conn->tls );
+		        SSL_free( HashEntry->server_conn->tls );
+		    }
+#endif
+		    close( HashEntry->server_conn->sd );
+		    free( HashEntry->server_conn );
+		}
+		else
 		{
-		    SSL_shutdown( HashEntry->server_conn->tls );
-		    SSL_free( HashEntry->server_conn->tls );
+		    syslog(LOG_WARNING, "Expiring freed ICC");
 		}
-#endif
-		close( HashEntry->server_conn->sd );
-		free( HashEntry->server_conn );
 		
 		/*
 		 * This was being counted as a "retained" connection.  It was

This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.


------------------------------------------------------------------------------
-----
squirrelmail-cvs mailing list
List address: squirrelmail-cvs@lists.sourceforge.net
List info (subscribe/unsubscribe/change options): \
                https://lists.sourceforge.net/lists/listinfo/squirrelmail-cvs
Repository: http://squirrelmail.org/svn


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic