diff options
author | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-07-19 19:06:03 +0000 |
---|---|---|
committer | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-07-19 19:06:03 +0000 |
commit | 681324b3bc5d02d6fe8fff0c057fccbe2643ff4b (patch) | |
tree | 40bffca91d6fabac51c2ade91fbdb0f1093ff045 /usr.sbin/smtpd | |
parent | cf8133281313c3daa4dce5de3450f41a2e3c9fdd (diff) |
fix fwrite return code checking.
bug exposed by recent change to fwrite, and reported by oga.
ok gilles
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r-- | usr.sbin/smtpd/smtp_session.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c index ea47532147d..5e9bc692840 100644 --- a/usr.sbin/smtpd/smtp_session.c +++ b/usr.sbin/smtpd/smtp_session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtp_session.c,v 1.107 2009/06/06 04:14:21 pyr Exp $ */ +/* $OpenBSD: smtp_session.c,v 1.108 2009/07/19 19:06:02 jacekm Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -841,7 +841,7 @@ session_read_data(struct session *s, char *line, size_t nread) len = strlen(line); - if (fwrite(line, len, 1, s->datafp) != 1 || + if (fwrite(line, 1, len, s->datafp) != len || fwrite("\n", 1, 1, s->datafp) != 1) { s->s_msg.status |= S_MESSAGE_TEMPFAILURE; return; |