dovecot-1.2: imap/pop3-login: Don't crash if passdb returns prox...

dovecot at dovecot.org dovecot at dovecot.org
Mon Dec 6 08:05:00 EET 2010


details:   http://hg.dovecot.org/dovecot-1.2/rev/ebc5dc47eb59
changeset: 9634:ebc5dc47eb59
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Dec 06 06:04:54 2010 +0000
description:
imap/pop3-login: Don't crash if passdb returns proxy field without host.

diffstat:

 src/imap-login/imap-proxy.c |  5 +++++
 src/pop3-login/pop3-proxy.c |  5 +++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diffs (30 lines):

diff -r c447114b0f89 -r ebc5dc47eb59 src/imap-login/imap-proxy.c
--- a/src/imap-login/imap-proxy.c	Thu Dec 02 04:37:38 2010 +0000
+++ b/src/imap-login/imap-proxy.c	Mon Dec 06 06:04:54 2010 +0000
@@ -436,6 +436,11 @@
 		client_send_tagline(client, PROXY_FAILURE_MSG);
 		return -1;
 	}
+	if (host == NULL || *host == '\0') {
+		client_syslog_err(&client->common, "proxy: host not given");
+		client_send_tagline(client, PROXY_FAILURE_MSG);
+		return -1;
+	}
 
 	i_assert(client->refcount > 1);
 	connection_queue_add(1);
diff -r c447114b0f89 -r ebc5dc47eb59 src/pop3-login/pop3-proxy.c
--- a/src/pop3-login/pop3-proxy.c	Thu Dec 02 04:37:38 2010 +0000
+++ b/src/pop3-login/pop3-proxy.c	Mon Dec 06 06:04:54 2010 +0000
@@ -271,6 +271,11 @@
 		client_send_line(client, PROXY_FAILURE_MSG);
 		return -1;
 	}
+	if (host == NULL || *host == '\0') {
+		client_syslog_err(&client->common, "proxy: host not given");
+		client_send_line(client, PROXY_FAILURE_MSG);
+		return -1;
+	}
 
 	i_assert(client->refcount > 1);
 	connection_queue_add(1);


More information about the dovecot-cvs mailing list