From a7f92c5e88155c01d0de5b03626d3cbac8bc57d3 Mon Sep 17 00:00:00 2001 From: Jacek Masiulaniec Date: Fri, 17 Apr 2009 16:26:19 +0000 Subject: handle case when no input is provided, fixes confusing error: $ echo -n | sendmail root sendmail: write: connection closed $ --- usr.sbin/smtpd/enqueue.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.sbin/smtpd/enqueue.c b/usr.sbin/smtpd/enqueue.c index bff3bcb90f6..24c27317646 100644 --- a/usr.sbin/smtpd/enqueue.c +++ b/usr.sbin/smtpd/enqueue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: enqueue.c,v 1.12 2009/04/16 15:35:06 jacekm Exp $ */ +/* $OpenBSD: enqueue.c,v 1.13 2009/04/17 16:26:18 jacekm Exp $ */ /* * Copyright (c) 2005 Henning Brauer @@ -691,7 +691,8 @@ send_message(int noheader) if (noheader) femail_write("\r\n", 2); - femail_write(msg.data, msg.len); + if (msg.data != NULL) + femail_write(msg.data, msg.len); } void -- cgit v1.2.3