summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/smtp_session.c
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2014-11-02 21:46:04 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2014-11-02 21:46:04 +0000
commit32bf373ace01416a385b41e67fe1954f844aee25 (patch)
treed739acad4239e0bfe489d1948de6b2d130b23cd6 /usr.sbin/smtpd/smtp_session.c
parent1a7347790a5ceb7946c174de2f1ff4ff4fcfeea6 (diff)
increment s->datalen counter in append domain code to correctly account for
the data we wrote
Diffstat (limited to 'usr.sbin/smtpd/smtp_session.c')
-rw-r--r--usr.sbin/smtpd/smtp_session.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c
index abdaab0e19c..389942bdda7 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.219 2014/11/02 21:13:32 gilles Exp $ */
+/* $OpenBSD: smtp_session.c,v 1.220 2014/11/02 21:46:03 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -406,6 +406,7 @@ header_masquerade_callback(const struct rfc2822_header *hdr, void *arg)
if (skip) {
if (fprintf(s->ofile, "%c", l->buffer[i]) != (int)1)
goto ioerror;
+ s->datalen += 1;
}
else {
buffer[j++] = l->buffer[i];
@@ -413,6 +414,7 @@ header_masquerade_callback(const struct rfc2822_header *hdr, void *arg)
len = strlen(buffer);
if (fprintf(s->ofile, "%s", buffer) != (int)len)
goto ioerror;
+ s->datalen += len;
skip = 1;
j = 0;
memset(buffer, 0, sizeof buffer);
@@ -423,6 +425,7 @@ header_masquerade_callback(const struct rfc2822_header *hdr, void *arg)
if (skip) {
if (fprintf(s->ofile, "\n") != (int)1)
goto ioerror;
+ s->datalen += 1;
}
else {
buffer[j++] = '\n';
@@ -430,6 +433,7 @@ header_masquerade_callback(const struct rfc2822_header *hdr, void *arg)
len = strlen(buffer);
if (fprintf(s->ofile, "%s", buffer) != (int)len)
goto ioerror;
+ s->datalen += len;
skip = 1;
j = 0;
memset(buffer, 0, sizeof buffer);
@@ -444,6 +448,7 @@ header_masquerade_callback(const struct rfc2822_header *hdr, void *arg)
len = strlen(buffer);
if (fprintf(s->ofile, "%s", buffer) != (int)len)
goto ioerror;
+ s->datalen += len;
}
return;