changeset 12398:748e613fd73a

lmtp proxy: Don't internally finish proxying before client has even sent DATA command. This fixes some crashes when all recipients were invalid.
author Timo Sirainen <tss@iki.fi>
date Mon, 08 Nov 2010 18:37:25 +0000
parents 2a252c9cda5e
children 97e60c1a4f8d
files src/lmtp/lmtp-proxy.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lmtp/lmtp-proxy.c	Mon Nov 08 18:30:05 2010 +0000
+++ b/src/lmtp/lmtp-proxy.c	Mon Nov 08 18:37:25 2010 +0000
@@ -202,6 +202,10 @@
 
 static void lmtp_proxy_try_finish(struct lmtp_proxy *proxy)
 {
+	if (proxy->finish_callback == NULL) {
+		/* DATA command hasn't been sent yet */
+		return;
+	}
 	if (lmtp_proxy_send_data_replies(proxy) &&
 	    (proxy->data_input == NULL ||
 	     proxy->data_input->eof ||