summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreric <eric@openbsd.org>2016-11-25 16:17:41 +0000
committereric <eric@openbsd.org>2016-11-25 16:17:41 +0000
commite21fb9f2aa9c17520943f939f7339cd76c8ba722 (patch)
treecac3783fd2bf62f3db2058505ddb440f3c5fbb23
parentNuke the DHO_ROUTERS and DHO_STATIC_ROUTES options from the effective (diff)
downloadwireguard-openbsd-e21fb9f2aa9c17520943f939f7339cd76c8ba722.tar.xz
wireguard-openbsd-e21fb9f2aa9c17520943f939f7339cd76c8ba722.zip
normalize iobuf before reading into it.
fix regression introduced in recent cleanup ok gilles@
-rw-r--r--usr.sbin/smtpd/ioev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/ioev.c b/usr.sbin/smtpd/ioev.c
index ad1324eeb20..6bb06fd035d 100644
--- a/usr.sbin/smtpd/ioev.c
+++ b/usr.sbin/smtpd/ioev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ioev.c,v 1.36 2016/11/24 21:25:21 eric Exp $ */
+/* $OpenBSD: ioev.c,v 1.37 2016/11/25 16:17:41 eric Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@openbsd.org>
*
@@ -685,6 +685,7 @@ io_dispatch(int fd, short ev, void *humppa)
read:
if (ev & EV_READ) {
+ iobuf_normalize(io->iobuf);
if ((n = iobuf_read(io->iobuf, io->sock)) < 0) {
if (n == IOBUF_CLOSED)
io_callback(io, IO_DISCONNECTED);
@@ -914,6 +915,7 @@ io_dispatch_read_ssl(int fd, short event, void *humppa)
}
again:
+ iobuf_normalize(io->iobuf);
switch ((n = iobuf_read_ssl(io->iobuf, (SSL*)io->ssl))) {
case IOBUF_WANT_READ:
io_reset(io, EV_READ, io_dispatch_read_ssl);