[dovecot-cvs] dovecot/src/pop3-login pop3-proxy.c,1.17,1.18

tss at dovecot.org tss at dovecot.org
Thu Feb 15 13:31:55 UTC 2007


Update of /var/lib/cvs/dovecot/src/pop3-login
In directory talvi:/tmp/cvs-serv24821/pop3-login

Modified Files:
	pop3-proxy.c 
Log Message:
Don't crash if the remote server disconnects before we're logged in.



Index: pop3-proxy.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/pop3-login/pop3-proxy.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- pop3-proxy.c	19 Jan 2007 21:19:52 -0000	1.17
+++ pop3-proxy.c	15 Feb 2007 13:31:52 -0000	1.18
@@ -16,8 +16,6 @@
 	string_t *str;
 	const char *line, *msg;
 
-	i_assert(!client->destroyed);
-
 	if (input == NULL) {
 		if (client->io != NULL) {
 			/* remote authentication failed, we're just
@@ -25,6 +23,11 @@
 			return;
 		}
 
+		if (client->destroyed) {
+			/* we came here from client_destroy() */
+			return;
+		}
+
 		/* failed for some reason, probably server disconnected */
 		client_send_line(client,
 				 "-ERR [IN-USE] Temporary login failure.");
@@ -32,6 +35,8 @@
 		return;
 	}
 
+	i_assert(!client->destroyed);
+
 	switch (i_stream_read(input)) {
 	case -2:
 		/* buffer full */



More information about the dovecot-cvs mailing list