Mercurial > dovecot > original-hg > dovecot-1.2
changeset 9634:ebc5dc47eb59 HEAD
imap/pop3-login: Don't crash if passdb returns proxy field without host.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 06 Dec 2010 06:04:54 +0000 |
parents | c447114b0f89 |
children | 0b3b0cc96006 |
files | src/imap-login/imap-proxy.c src/pop3-login/pop3-proxy.c |
diffstat | 2 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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);
--- 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);